diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 3c95007..ea6cf7d 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -41,3 +41,7 @@ jobs: run: mix deps.get - name: Run tests run: mix test + - name: format check + run: mix format --check-formatted + - name: Run credo + run: mix credo diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..4bb8de1 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,25 @@ +on: + push: + branches: + - main + paths: + - 'native/**' + pull_request: + paths: + - 'native/**' + workflow_dispatch: + + +jobs: + lint: + name: Rust linter + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Run clippy + run: cargo clippy + working-directory: native/yex + - name: format check + run: cargo fmt --check + working-directory: native/yex diff --git a/.gitignore b/.gitignore index 2febb75..9559f57 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,6 @@ y_ex-*.tar # Temporary files, for example, from tests. /tmp/ -priv/native/*.so \ No newline at end of file +priv/native/*.so + +checksum-*.exs \ No newline at end of file diff --git a/lib/array.ex b/lib/array.ex index bc18463..5a78e95 100644 --- a/lib/array.ex +++ b/lib/array.ex @@ -1,4 +1,7 @@ defmodule Yex.Array do + @moduledoc """ + A shareable Array-like type that supports efficient insert/delete of elements at any position. + """ defstruct [ :reference ] @@ -45,6 +48,18 @@ defmodule Yex.Array do end defmodule Yex.ArrayPrelim do + @moduledoc """ + A preliminary array. It can be used to early initialize the contents of a Array. + + ## Examples + iex> doc = Yex.Doc.new() + iex> map = Yex.Doc.get_map(doc, "map") + iex> Yex.Map.set(map, "key", Yex.ArrayPrelim.from(["Hello", "World"])) + iex> {:ok, %Yex.Array{} = array} = Yex.Map.get(map, "key") + iex> Yex.Array.get(array, 1) + {:ok, "World"} + + """ defstruct [ :list ] diff --git a/lib/doc.ex b/lib/doc.ex index 673e651..f88a1c3 100644 --- a/lib/doc.ex +++ b/lib/doc.ex @@ -1,5 +1,8 @@ defmodule Yex.Doc do defmodule Options do + @moduledoc """ + Document options. + """ defstruct client_id: 0, guid: nil, collection_id: nil, diff --git a/lib/map.ex b/lib/map.ex index 91d4339..43e45a0 100644 --- a/lib/map.ex +++ b/lib/map.ex @@ -1,4 +1,7 @@ defmodule Yex.Map do + @moduledoc """ + A shareable Map type. + """ defstruct [ :reference ] @@ -33,6 +36,17 @@ defmodule Yex.Map do end defmodule Yex.MapPrelim do + @moduledoc """ + A preliminary map. It can be used to early initialize the contents of a Map. + + ## Examples + iex> doc = Yex.Doc.new() + iex> array = Yex.Doc.get_array(doc, "array") + iex> Yex.Array.insert(array, 0, Yex.MapPrelim.from(%{ "key" => "value" })) + iex> {:ok, %Yex.Map{} = map} = Yex.Array.get(array, 0) + iex> Yex.Map.get(map, "key") + {:ok, "value"} + """ defstruct [ :map ] diff --git a/lib/nif.ex b/lib/nif.ex index b45303a..87d1dcd 100644 --- a/lib/nif.ex +++ b/lib/nif.ex @@ -1,16 +1,16 @@ defmodule Yex.Nif do + @moduledoc false + # Do not use directly version = Mix.Project.config()[:version] use RustlerPrecompiled, otp_app: :y_ex, crate: "yex", - base_url: - "https://github.com/satoren/y_ex/releases/download/v#{version}", + base_url: "https://github.com/satoren/y_ex/releases/download/v#{version}", force_build: System.get_env("RUSTLER_PRECOMPILATION_YEX_BUILD") in ["1", "true"], version: version - def doc_new(), do: :erlang.nif_error(:nif_not_loaded) def doc_with_options(_option), do: :erlang.nif_error(:nif_not_loaded) def doc_get_or_insert_text(_doc, _name), do: :erlang.nif_error(:nif_not_loaded) diff --git a/lib/text.ex b/lib/text.ex index 0404c03..29a2eea 100644 --- a/lib/text.ex +++ b/lib/text.ex @@ -1,4 +1,7 @@ defmodule Yex.Text do + @moduledoc """ + A shareable type that is optimized for shared editing on text. + """ defstruct [ :reference ] @@ -37,7 +40,6 @@ defmodule Yex.Text do end def to_json(%__MODULE__{} = _text) do - # todo: need to implement raise "Not implemented" end end diff --git a/mix.exs b/mix.exs index 4589de3..11db31e 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Yex.MixProject do use Mix.Project - @version "0.0.3" + @version "0.0.4" @repo "https://github.com/satoren/y_ex" @description """ @@ -51,7 +51,8 @@ defmodule Yex.MixProject do [ {:rustler, ">= 0.0.0", optional: true}, {:rustler_precompiled, "~> 0.7"}, - {:ex_doc, "~> 0.29", only: :dev, runtime: false} + {:ex_doc, "~> 0.29", only: :dev, runtime: false}, + {:credo, "~> 1.7", only: [:dev, :test], runtime: false} ] end end diff --git a/mix.lock b/mix.lock index 0eb40bd..beb0c7e 100644 --- a/mix.lock +++ b/mix.lock @@ -1,7 +1,10 @@ %{ + "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, "castore": {:hex, :castore, "1.0.8", "dedcf20ea746694647f883590b82d9e96014057aff1d44d03ec90f36a5c0dc6e", [:mix], [], "hexpm", "0b2b66d2ee742cb1d9cb8c8be3b43c3a70ee8651f37b75a8b982e036752983f1"}, + "credo": {:hex, :credo, "1.7.7", "771445037228f763f9b2afd612b6aa2fd8e28432a95dbbc60d8e03ce71ba4446", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "8bc87496c9aaacdc3f90f01b7b0582467b69b4bd2441fe8aae3109d843cc2f2e"}, "earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"}, "ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"}, + "file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"}, "jason": {:hex, :jason, "1.4.3", "d3f984eeb96fe53b85d20e0b049f03e57d075b5acda3ac8d465c969a2536c17b", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "9a90e868927f7c777689baa16d86f4d0e086d968db5c05d917ccff6d443e58a3"}, "makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"}, "makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"}, diff --git a/native/yex/src/any.rs b/native/yex/src/any.rs index 2d535d0..6df8c8a 100644 --- a/native/yex/src/any.rs +++ b/native/yex/src/any.rs @@ -63,7 +63,7 @@ fn decode<'a>(term: Term<'a>) -> NifResult { return Ok(Any::from(a)); } - return Err(rustler::Error::BadArg); + Err(rustler::Error::BadArg) } pub type NifAny = NifWrap; diff --git a/native/yex/src/array.rs b/native/yex/src/array.rs index a376375..1bc99a6 100644 --- a/native/yex/src/array.rs +++ b/native/yex/src/array.rs @@ -23,14 +23,14 @@ pub struct NifArray { impl NifArray { pub fn new(doc: ResourceArc, array: ArrayRef) -> Self { NifArray { - doc: doc, + doc, reference: ResourceArc::new(array.into()), } } pub fn insert(&self, index: u32, input: NifYInput) -> Result<(), NifError> { - if let Some(mut txn) = self.doc.current_transaction.borrow_mut().as_mut() { - self.reference.insert(&mut txn, index, input); + if let Some(txn) = self.doc.current_transaction.borrow_mut().as_mut() { + self.reference.insert(txn, index, input); Ok(()) } else { let mut txn = self.doc.0.doc.transact_mut(); diff --git a/native/yex/src/doc.rs b/native/yex/src/doc.rs index a41215a..7c9c841 100644 --- a/native/yex/src/doc.rs +++ b/native/yex/src/doc.rs @@ -74,15 +74,15 @@ impl From for Options { } else { uuid_v4() }; - return Options { + Options { client_id: w.client_id, - guid: guid, + guid, collection_id: w.collection_id, - offset_kind: offset_kind, + offset_kind, skip_gc: w.skip_gc, auto_load: w.auto_load, should_load: w.should_load, - }; + } } } @@ -107,7 +107,7 @@ impl NifDoc { NifDoc { reference: ResourceArc::new( DocInner { - doc: doc, + doc, current_transaction: RefCell::new(None), } .into(), @@ -148,7 +148,7 @@ impl NifDoc { Ok(()) } - pub fn commit_transaction(&self) -> () { + pub fn commit_transaction(&self) { *self.reference.current_transaction.borrow_mut() = None; } diff --git a/native/yex/src/error.rs b/native/yex/src/error.rs index f6fcbe1..05c31a8 100644 --- a/native/yex/src/error.rs +++ b/native/yex/src/error.rs @@ -9,9 +9,9 @@ pub struct NifError { impl From for NifError { fn from(w: yrs::doc::TransactionAcqError) -> NifError { - return NifError { + NifError { reason: atoms::transaction_acq_error(), message: w.to_string(), - }; + } } } diff --git a/native/yex/src/lib.rs b/native/yex/src/lib.rs index d1edaf0..6c291d1 100644 --- a/native/yex/src/lib.rs +++ b/native/yex/src/lib.rs @@ -84,17 +84,17 @@ fn doc_with_options(option: NifOptions) -> NifDoc { } #[rustler::nif] -fn doc_get_or_insert_text<'a>(env: Env<'a>, doc: NifDoc, name: &str) -> NifText { +fn doc_get_or_insert_text(env: Env<'_>, doc: NifDoc, name: &str) -> NifText { ENV.set(&mut env.clone(), || doc.get_or_insert_text(name)) } #[rustler::nif] -fn doc_get_or_insert_array<'a>(env: Env<'a>, doc: NifDoc, name: &str) -> NifArray { +fn doc_get_or_insert_array(env: Env<'_>, doc: NifDoc, name: &str) -> NifArray { ENV.set(&mut env.clone(), || doc.get_or_insert_array(name)) } #[rustler::nif] -fn doc_get_or_insert_map<'a>(env: Env<'a>, doc: NifDoc, name: &str) -> NifMap { +fn doc_get_or_insert_map(env: Env<'_>, doc: NifDoc, name: &str) -> NifMap { ENV.set(&mut env.clone(), || doc.get_or_insert_map(name)) } @@ -108,7 +108,7 @@ fn doc_begin_transaction(doc: NifDoc, origin: Option<&str>) -> Result<(), NifErr } #[rustler::nif] -fn doc_commit_transaction<'a>(env: Env<'a>, doc: NifDoc) -> () { +fn doc_commit_transaction(env: Env<'_>, doc: NifDoc) { ENV.set(&mut env.clone(), || doc.commit_transaction()) } @@ -128,13 +128,13 @@ fn doc_monitor_update_v2( } #[rustler::nif] -fn text_insert<'a>(env: Env<'a>, text: NifText, index: u32, chunk: &str) -> Result<(), NifError> { +fn text_insert(env: Env<'_>, text: NifText, index: u32, chunk: &str) -> Result<(), NifError> { ENV.set(&mut env.clone(), || text.insert(index, chunk)) } #[rustler::nif] -fn text_insert_with_attributes<'a>( - env: Env<'a>, +fn text_insert_with_attributes( + env: Env<'_>, text: NifText, index: u32, chunk: &str, @@ -146,13 +146,13 @@ fn text_insert_with_attributes<'a>( } #[rustler::nif] -fn text_delete<'a>(env: Env<'a>, text: NifText, index: u32, len: u32) -> Result<(), NifError> { +fn text_delete(env: Env<'_>, text: NifText, index: u32, len: u32) -> Result<(), NifError> { ENV.set(&mut env.clone(), || text.delete(index, len)) } #[rustler::nif] -fn text_format<'a>( - env: Env<'a>, +fn text_format( + env: Env<'_>, text: NifText, index: u32, len: u32, @@ -171,8 +171,8 @@ fn text_length(text: NifText) -> u32 { } #[rustler::nif] -fn array_insert<'a>( - env: Env<'a>, +fn array_insert( + env: Env<'_>, array: NifArray, index: u32, value: NifYInput, @@ -188,8 +188,8 @@ fn array_get(array: NifArray, index: u32) -> Result { array.get(index) } #[rustler::nif] -fn array_delete_range<'a>( - env: Env<'a>, +fn array_delete_range( + env: Env<'_>, array: NifArray, index: u32, length: u32, @@ -206,7 +206,7 @@ fn array_to_json(array: NifArray) -> NifAny { } #[rustler::nif] -fn map_set<'a>(env: Env<'a>, map: NifMap, key: &str, value: NifYInput) -> Result<(), NifError> { +fn map_set(env: Env<'_>, map: NifMap, key: &str, value: NifYInput) -> Result<(), NifError> { ENV.set(&mut env.clone(), || map.set(key, value)) } #[rustler::nif] @@ -218,7 +218,7 @@ fn map_get(map: NifMap, key: &str) -> Result { map.get(key) } #[rustler::nif] -fn map_delete<'a>(env: Env<'a>, map: NifMap, key: &str) -> Result<(), NifError> { +fn map_delete(env: Env<'_>, map: NifMap, key: &str) -> Result<(), NifError> { ENV.set(&mut env.clone(), || map.delete(key)) } #[rustler::nif] @@ -231,10 +231,7 @@ fn map_to_json(map: NifMap) -> NifAny { } #[rustler::nif] -fn sub_unsubscribe<'a>( - env: Env<'a>, - sub: ResourceArc, -) -> Result<(), NifError> { +fn sub_unsubscribe(env: Env<'_>, sub: ResourceArc) -> Result<(), NifError> { ENV.set(&mut env.clone(), || { *sub.borrow_mut() = None; Ok(()) @@ -261,7 +258,7 @@ fn encode_state_as_update<'a>( }) } #[rustler::nif] -fn apply_update<'a>(env: Env<'a>, doc: NifDoc, update: Binary) -> Result<(), NifError> { +fn apply_update(env: Env<'_>, doc: NifDoc, update: Binary) -> Result<(), NifError> { ENV.set(&mut env.clone(), || doc.apply_update(update.as_slice())) } diff --git a/native/yex/src/map.rs b/native/yex/src/map.rs index 0858846..48e9a76 100644 --- a/native/yex/src/map.rs +++ b/native/yex/src/map.rs @@ -20,7 +20,7 @@ pub struct NifMap { impl NifMap { pub fn new(doc: ResourceArc, map: MapRef) -> Self { NifMap { - doc: doc, + doc, reference: ResourceArc::new(map.into()), } } @@ -36,8 +36,8 @@ impl NifMap { } pub fn set(&self, key: &str, input: NifYInput) -> Result<(), NifError> { - if let Some(mut txn) = self.doc.current_transaction.borrow_mut().as_mut() { - self.reference.insert(&mut txn, key, input); + if let Some(txn) = self.doc.current_transaction.borrow_mut().as_mut() { + self.reference.insert(txn, key, input); Ok(()) } else { let mut txn = self.doc.0.doc.transact_mut(); diff --git a/native/yex/src/text.rs b/native/yex/src/text.rs index 0377d07..f9316b2 100644 --- a/native/yex/src/text.rs +++ b/native/yex/src/text.rs @@ -16,18 +16,20 @@ pub struct NifText { impl NifText { pub fn new(doc: ResourceArc, text: TextRef) -> Self { NifText { - doc: doc, + doc, reference: ResourceArc::new(text.into()), } } pub fn insert(&self, index: u32, chunk: &str) -> Result<(), NifError> { - if let Some(mut txn) = self.doc.current_transaction.borrow_mut().as_mut() { - Ok(self.reference.insert(&mut txn, index, chunk)) + if let Some(txn) = self.doc.current_transaction.borrow_mut().as_mut() { + self.reference.insert(txn, index, chunk); + Ok(()) } else { let mut txn = self.doc.0.doc.transact_mut(); - Ok(self.reference.insert(&mut txn, index, chunk)) + self.reference.insert(&mut txn, index, chunk); + Ok(()) } } @@ -37,54 +39,61 @@ impl NifText { chunk: &str, attr: NifAttr, ) -> Result<(), NifError> { - if let Some(mut txn) = self.doc.current_transaction.borrow_mut().as_mut() { - Ok(self - .reference - .insert_with_attributes(&mut txn, index, chunk, attr.0)) + if let Some(txn) = self.doc.current_transaction.borrow_mut().as_mut() { + self.reference + .insert_with_attributes(txn, index, chunk, attr.0); + Ok(()) } else { let mut txn = self.doc.0.doc.transact_mut(); - Ok(self - .reference - .insert_with_attributes(&mut txn, index, chunk, attr.0)) + self.reference + .insert_with_attributes(&mut txn, index, chunk, attr.0); + Ok(()) } } pub fn delete(&self, index: u32, len: u32) -> Result<(), NifError> { - if let Some(mut txn) = self.doc.current_transaction.borrow_mut().as_mut() { - Ok(self.reference.remove_range(&mut txn, index, len)) + if let Some(txn) = self.doc.current_transaction.borrow_mut().as_mut() { + self.reference.remove_range(txn, index, len); + Ok(()) } else { let mut txn = self.doc.0.doc.transact_mut(); - Ok(self.reference.remove_range(&mut txn, index, len)) + self.reference.remove_range(&mut txn, index, len); + Ok(()) } } pub fn format(&self, index: u32, len: u32, attr: NifAttr) -> Result<(), NifError> { - if let Some(mut txn) = self.doc.current_transaction.borrow_mut().as_mut() { - Ok(self.reference.format(&mut txn, index, len, attr.0)) + if let Some(txn) = self.doc.current_transaction.borrow_mut().as_mut() { + self.reference.format(txn, index, len, attr.0); + Ok(()) } else { let mut txn = self.doc.0.doc.transact_mut(); - Ok(self.reference.format(&mut txn, index, len, attr.0)) + self.reference.format(&mut txn, index, len, attr.0); + Ok(()) } } - pub fn to_string(&self) -> String { + pub fn length(&self) -> u32 { if let Some(txn) = self.doc.current_transaction.borrow_mut().as_mut() { - self.reference.get_string(txn) + self.reference.len(txn) } else { let txn = self.doc.0.doc.transact(); - self.reference.get_string(&txn) + self.reference.len(&txn) } } - pub fn length(&self) -> u32 { +} + +impl std::fmt::Display for NifText { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { if let Some(txn) = self.doc.current_transaction.borrow_mut().as_mut() { - self.reference.len(txn) + write!(f, "{}", self.reference.get_string(txn)) } else { let txn = self.doc.0.doc.transact(); - self.reference.len(&txn) + write!(f, "{}", self.reference.get_string(&txn)) } } } diff --git a/native/yex/src/wrap.rs b/native/yex/src/wrap.rs index 5910a31..d2deb98 100644 --- a/native/yex/src/wrap.rs +++ b/native/yex/src/wrap.rs @@ -9,7 +9,7 @@ unsafe impl Sync for NifWrap {} impl From for NifWrap { fn from(w: T) -> NifWrap { - return NifWrap::(w); + NifWrap::(w) } } diff --git a/native/yex/src/youtput.rs b/native/yex/src/youtput.rs index 4172367..d8a6819 100644 --- a/native/yex/src/youtput.rs +++ b/native/yex/src/youtput.rs @@ -26,11 +26,11 @@ impl NifValue { yrs::Value::YText(text) => NifValue::YText(NifText::new(doc, text)), yrs::Value::YArray(array) => NifValue::YArray(NifArray::new(doc, array)), yrs::Value::YMap(map) => NifValue::YMap(NifMap::new(doc, map)), - yrs::Value::YXmlElement(_) => NifValue::YXmlElement(NifXmlElement { doc: doc }), + yrs::Value::YXmlElement(_) => NifValue::YXmlElement(NifXmlElement { doc }), yrs::Value::YXmlFragment(_) => NifValue::YXmlFragment(NifXmlFragment {}), - yrs::Value::YXmlText(_) => NifValue::YXmlText(NifXmlText { doc: doc }), + yrs::Value::YXmlText(_) => NifValue::YXmlText(NifXmlText { doc }), yrs::Value::YDoc(doc) => NifValue::YDoc(NifDoc::from_native(doc)), - yrs::Value::UndefinedRef(_) => NifValue::UndefinedRef(NifUndefinedRef { doc: doc }), + yrs::Value::UndefinedRef(_) => NifValue::UndefinedRef(NifUndefinedRef { doc }), } } } diff --git a/test/array_test.exs b/test/array_test.exs index 6ac2913..83fcad2 100644 --- a/test/array_test.exs +++ b/test/array_test.exs @@ -1,7 +1,8 @@ defmodule Yex.ArrayTest do use ExUnit.Case alias Yex.{Doc, Array, ArrayPrelim} - doctest Doc + doctest Array + doctest ArrayPrelim test "insert" do doc = Doc.new() diff --git a/test/map_test.exs b/test/map_test.exs index bcb1795..b70a9b2 100644 --- a/test/map_test.exs +++ b/test/map_test.exs @@ -1,7 +1,8 @@ defmodule Yex.MapTest do use ExUnit.Case alias Yex.{Doc, Map, MapPrelim} - doctest Doc + doctest Map + doctest MapPrelim test "set" do doc = Doc.new() diff --git a/test/text_test.exs b/test/text_test.exs index deb6001..eb60200 100644 --- a/test/text_test.exs +++ b/test/text_test.exs @@ -1,7 +1,7 @@ defmodule Yex.TextTest do use ExUnit.Case alias Yex.{Doc, Text} - doctest Doc + doctest Text test "transaction" do doc = Doc.new()