diff options
| author | Sébastien Dailly <sebastien@dailly.me> | 2026-05-06 16:40:54 +0200 |
|---|---|---|
| committer | Sébastien Dailly <sebastien@dailly.me> | 2026-05-06 16:44:25 +0200 |
| commit | a5efd7d15b4d049a4ed539ed5d9c2f1037d00973 (patch) | |
| tree | 9b1f002f487b94c8ec7a6b37b761f2d2def10208 | |
| parent | ae4814880d7a2ad9c96e8f4001edf5032b9a7fb2 (diff) | |
Use the double dash as arguments in tests
| -rw-r--r-- | lib/configuration/tests/configuration.t | 8 | ||||
| -rw-r--r-- | lib/configuration/tests/errors.t | 10 | ||||
| -rw-r--r-- | lib/configuration/tests/tree.t | 8 | ||||
| -rw-r--r-- | lib/model/tests/parent.t | 10 | ||||
| -rw-r--r-- | lib/query/tests/create.t | 10 | ||||
| -rw-r--r-- | lib/query/tests/insert.t | 18 | ||||
| -rw-r--r-- | lib/splay/tests/splay.t | 44 | ||||
| -rw-r--r-- | test/configuration_.ml | 4 | ||||
| -rw-r--r-- | test/parent.ml | 2 | ||||
| -rw-r--r-- | test/splay_tree.ml | 6 | ||||
| -rw-r--r-- | test/tests.ml | 2 |
11 files changed, 61 insertions, 61 deletions
diff --git a/lib/configuration/tests/configuration.t b/lib/configuration/tests/configuration.t index a732db6..e44b91a 100644 --- a/lib/configuration/tests/configuration.t +++ b/lib/configuration/tests/configuration.t @@ -2,7 +2,7 @@ The configuration is written in JSON5 format. Minimal configuration file with nothing: - $ tests -configuration <<EOF + $ tests --configuration <<EOF > { "content" : [] } > > EOF @@ -10,7 +10,7 @@ Minimal configuration file with nothing: Trailing coma are accepted: - $ tests -configuration <<EOF + $ tests --configuration <<EOF > { "content" : > [ > { @@ -23,7 +23,7 @@ Trailing coma are accepted: Comments are accepted: - $ tests -configuration <<EOF + $ tests --configuration <<EOF > { "content" : > [ > { @@ -37,7 +37,7 @@ Comments are accepted: Cycles between elements are accepted when they are not mandatory to each other - $ tests -configuration <<EOF + $ tests --configuration <<EOF > { > "content": [ > { diff --git a/lib/configuration/tests/errors.t b/lib/configuration/tests/errors.t index 6b5584e..58c15ed 100644 --- a/lib/configuration/tests/errors.t +++ b/lib/configuration/tests/errors.t @@ -2,7 +2,7 @@ Differents invalid configuration. All of them shall report the error properly Every content shall have an identifier - $ tests -configuration <<EOF + $ tests --configuration <<EOF > { > "content": [ > { @@ -18,7 +18,7 @@ Every content shall have an identifier The content ID cannot be empty: - $ tests -configuration <<EOF + $ tests --configuration <<EOF > { > "content": [ > { @@ -33,7 +33,7 @@ The content ID cannot be empty: The content ID cannot be contains "." (this charater is used internaly): - $ tests -configuration <<EOF + $ tests --configuration <<EOF > { > "content": [ > { @@ -51,7 +51,7 @@ The content ID cannot be contains "." (this charater is used internaly): A reference shall point to an existing content: - $ tests -configuration <<EOF + $ tests --configuration <<EOF > { > "content": [ > { @@ -78,7 +78,7 @@ A reference shall point to an existing content: Cycles between required content are not accepted - $ tests -configuration <<EOF + $ tests --configuration <<EOF > { > "content": [ > { diff --git a/lib/configuration/tests/tree.t b/lib/configuration/tests/tree.t index b69c830..2e9df4b 100644 --- a/lib/configuration/tests/tree.t +++ b/lib/configuration/tests/tree.t @@ -4,7 +4,7 @@ configuration. Each reference field introduce a dependency between the content having the field and the content targeted by the field. - $ tests -configuration -tree <<EOF + $ tests --configuration --tree <<EOF > { > "content": [ > { @@ -42,7 +42,7 @@ and the content targeted by the field. The tree only contains root elements. Links between subcontent are reported as link between their respective root content. - $ tests -configuration -tree <<EOF + $ tests --configuration --tree <<EOF > { > "content": [ > { @@ -81,7 +81,7 @@ link between their respective root content. } - $ tests -configuration -tree <<EOF + $ tests --configuration --tree <<EOF > { > "content": [ > { @@ -125,7 +125,7 @@ link between their respective root content. A content is allowed to loop to itself, directly or indirectly: - $ tests -configuration -tree <<EOF + $ tests --configuration --tree <<EOF > { > "content": [ > { diff --git a/lib/model/tests/parent.t b/lib/model/tests/parent.t index 8e77578..1ccf8e8 100644 --- a/lib/model/tests/parent.t +++ b/lib/model/tests/parent.t @@ -1,7 +1,7 @@ A root content does not have any parent - $ tests -parent "entity" <<EOF + $ tests --parent "entity" <<EOF > { > "content": [ > { @@ -14,7 +14,7 @@ A root content does not have any parent A root content is the root of itself - $ tests -parent -root "entity" <<EOF + $ tests --parent --root "entity" <<EOF > { > "content": [ > { @@ -27,7 +27,7 @@ A root content is the root of itself The parent of a subcontent shall never been None, and will target the container - $ tests -parent "details" <<EOF + $ tests --parent "details" <<EOF > { > "content": [ > { @@ -45,7 +45,7 @@ The parent of a subcontent shall never been None, and will target the container The parent element can be a subcontent itself - $ tests -parent "level2" <<EOF + $ tests --parent "level2" <<EOF > { > "content": [ > { @@ -68,7 +68,7 @@ The parent element can be a subcontent itself The root element is the top content - $ tests -parent -root "level2" <<EOF + $ tests --parent --root "level2" <<EOF > { > "content": [ > { diff --git a/lib/query/tests/create.t b/lib/query/tests/create.t index 565235a..6ba48c3 100644 --- a/lib/query/tests/create.t +++ b/lib/query/tests/create.t @@ -5,7 +5,7 @@ to be succesfully created). Test a single content with no field: - $ tests -schema "entity" <<EOF + $ tests --schema "entity" <<EOF > { > "content": [ > { @@ -19,7 +19,7 @@ Test a single content with no field: Text fields or numeric fields are created as columns directly in the table: - $ tests -schema "entity" <<EOF + $ tests --schema "entity" <<EOF > { > "content": [ > { @@ -52,7 +52,7 @@ Text fields or numeric fields are created as columns directly in the table: A subcontent is linked to the parent: - $ tests -schema "details" <<EOF + $ tests --schema "details" <<EOF > { > "content": [ > { @@ -73,7 +73,7 @@ A subcontent is linked to the parent: A reference field is declared as a foreign key to the linked element - $ tests -schema "entity" <<EOF + $ tests --schema "entity" <<EOF > { > "content": [ > { @@ -114,7 +114,7 @@ A reference field is declared as a foreign key to the linked element When the field is multivaluated, there is no column for this property in the table but a dedicated table is created: - $ tests -schema "entity" "entity.user_type" <<EOF + $ tests --schema "entity" "entity.user_type" <<EOF > { > "content": [ > { diff --git a/lib/query/tests/insert.t b/lib/query/tests/insert.t index 578dae4..e060ad4 100644 --- a/lib/query/tests/insert.t +++ b/lib/query/tests/insert.t @@ -7,7 +7,7 @@ subcontent) Minimal exemple, a content without any field does not have any value: - $ tests -insert <<EOF + $ tests --insert <<EOF > { > "content": [ > { @@ -25,7 +25,7 @@ Ensure an error is raised if the value does not match the expected type. Here, the year is declared as an integer, but the value is provided as string. This error is expected to be checked and reported. - $ tests -insert <<EOF + $ tests --insert <<EOF > { > "content": [ > { @@ -49,7 +49,7 @@ This error is expected to be checked and reported. Fatal error: exception Query__Encoder.TypeMismatch [2] - $ tests -insert <<EOF + $ tests --insert <<EOF > { > "content": [ > { @@ -85,7 +85,7 @@ This error is expected to be checked and reported. {"name":"name","year":1234} Any value can be omitted and will be replaced by the default value: - $ tests -insert <<EOF + $ tests --insert <<EOF > { > "content": [ > { @@ -113,7 +113,7 @@ If the field is "required" the value is still inserted: the requirement feature is only functionnal; this shall not block the creation of the content in the database. - $ tests -insert <<EOF + $ tests --insert <<EOF > { > "content": [ > { @@ -140,7 +140,7 @@ database. A subcontent is linked to the parent: - $ tests -insert <<EOF + $ tests --insert <<EOF > { > "content": [ > { @@ -208,7 +208,7 @@ A subcontent is linked to the parent: In this syntax, external references are declared inside the feature referencing them. - $ tests -insert <<EOF + $ tests --insert <<EOF > { > "content": [ > { @@ -269,7 +269,7 @@ Four contents are created for the type referential here: - Two as contents linked referenced by the content "entity" (ids 1 and 2). - Two as contents not referenced at all (ids 3 and 4). - $ tests -insert <<EOF + $ tests --insert <<EOF > { > "content": [ > { @@ -337,7 +337,7 @@ Four contents are created for the type referential here: Subcontent are also managed in the same way. - $ tests -insert <<EOF + $ tests --insert <<EOF > { > "content": [ > { diff --git a/lib/splay/tests/splay.t b/lib/splay/tests/splay.t index 628ccaa..64f77a6 100644 --- a/lib/splay/tests/splay.t +++ b/lib/splay/tests/splay.t @@ -6,9 +6,9 @@ See https://en.wikipedia.org/wiki/Splay_tree The root is the latest inserted node: - $ tests -splay_tree \ - > -add 5 \ - > -add 3 + $ tests --splay_tree \ + > --add 5 \ + > --add 3 digraph G { leaf_0 [shape=point] "3" -> leaf_0 @@ -19,9 +19,9 @@ The root is the latest inserted node: "5" -> leaf_2 } - $ tests -splay_tree \ - > -add 3 \ - > -add 5 + $ tests --splay_tree \ + > --add 3 \ + > --add 5 digraph G { "5" -> "3" leaf_0 [shape=point] @@ -34,11 +34,11 @@ The root is the latest inserted node: Collecting an element in the tree will push this node at the root: - $ tests -splay_tree \ - > -add 1 \ - > -add 2 \ - > -add 3 \ - > -get 2 + $ tests --splay_tree \ + > --add 1 \ + > --add 2 \ + > --add 3 \ + > --get 2 digraph G { "2" -> "1" leaf_0 [shape=point] @@ -52,12 +52,12 @@ Collecting an element in the tree will push this node at the root: "3" -> leaf_3 } - $ tests -splay_tree \ - > -add 1 \ - > -add 2 \ - > -add 3 \ - > -add 4 \ - > -get 1 + $ tests --splay_tree \ + > --add 1 \ + > --add 2 \ + > --add 3 \ + > --add 4 \ + > --get 1 digraph G { leaf_0 [shape=point] "1" -> leaf_0 @@ -76,11 +76,11 @@ Collecting an element in the tree will push this node at the root: Removing an element from the tree modify the structure - $ tests -splay_tree \ - > -add 1 \ - > -add 2 \ - > -add 3 \ - > -del 2 + $ tests --splay_tree \ + > --add 1 \ + > --add 2 \ + > --add 3 \ + > --del 2 digraph G { leaf_0 [shape=point] "1" -> leaf_0 diff --git a/test/configuration_.ml b/test/configuration_.ml index 0fd42fb..0cc01da 100644 --- a/test/configuration_.ml +++ b/test/configuration_.ml @@ -4,13 +4,13 @@ let printer = ref (fun formatter _ -> Format.pp_print_nothing formatter ()) let speclist = [ - ( "-tree", + ( "--tree", Arg.Unit (fun () -> printer := fun formater conf -> Configuration.Graph_tree.pp formater (Configuration.Ast.tree conf)), - "Print the depenncy tree between root contents" ); + "Print the dependency tree between root contents" ); ] type t = (Configuration.Ast.setting, Configuration.Read_conf.error) result diff --git a/test/parent.ml b/test/parent.ml index 4a15bfa..a13afda 100644 --- a/test/parent.ml +++ b/test/parent.ml @@ -8,7 +8,7 @@ let parent = ref Model.Content.parent let speclist = [ - ( "-root", + ( "--root", Arg.Unit (fun () -> parent := fun content -> Some (Model.Content.root content)), "Return the root element instead of the parent" ); diff --git a/test/splay_tree.ml b/test/splay_tree.ml index 318fc96..acd2f2b 100644 --- a/test/splay_tree.ml +++ b/test/splay_tree.ml @@ -14,13 +14,13 @@ let tree : unit T.t ref = ref (T.empty ()) let speclist = [ - ( "-add", + ( "--add", Arg.Int (fun n -> tree := T.add n () !tree), "Add an element in the tree" ); - ( "-del", + ( "--del", Arg.Int (fun n -> tree := T.remove n !tree), "Remove an element from the tree" ); - ( "-get", + ( "--get", Arg.Int (fun n -> ignore @@ T.find n !tree), "Get an element from the tree" ); ] diff --git a/test/tests.ml b/test/tests.ml index 5e2bd59..9242495 100644 --- a/test/tests.ml +++ b/test/tests.ml @@ -15,7 +15,7 @@ let register : (module Intf.T) -> string * Arg.spec * string = T.name |> String.lowercase_ascii |> Filename.remove_extension |> Filename.basename in - ( "-" ^ name, + ( "--" ^ name, Arg.Unit (fun () -> speclist := T.speclist; |
