From 9498ba6e3381f0599be7cd72942660abaed8a4a2 Mon Sep 17 00:00:00 2001 From: Genarito Date: Mon, 1 Nov 2021 22:23:19 -0300 Subject: [PATCH] Added all the tests --- .../duplicated_imports_simple.ura | 2 + DuplicatedKeyError/README.md | 3 + DuplicatedKeyError/duplicated_key.ura | 3 + DuplicatedKeyError/duplicated_key_aux_1.ura | 1 + DuplicatedKeyError/duplicated_key_aux_2.ura | 1 + DuplicatedVariableError/README.md | 3 + .../duplicated_variable.ura | 3 + .../duplicated_variable_1.ura | 1 + .../duplicated_variable_aux_1.ura | 1 + .../duplicated_variable_aux_2.ura | 1 + FileNotFoundError/file_not_found.ura | 1 + InvalidIndentationError/different_chars.ura | 3 + .../invalid_object_indentation.ura | 7 ++ .../more_than_4_difference.ura | 5 + .../not_divisible_by_4.ura | 2 + InvalidIndentationError/with_tabs.ura | 2 + ParseError/invalid_import_1.ura | 1 + ParseError/invalid_import_2.ura | 1 + ParseError/invalid_object_1.ura | 1 + ParseError/invalid_object_2.ura | 3 + ParseError/invalid_variable_definition_1.ura | 1 + ParseError/invalid_variable_definition_2.ura | 1 + ParseError/invalid_variable_definition_3.ura | 1 + ParseError/invalid_variable_definition_4.ura | 1 + ParseError/invalid_variable_with_object.ura | 3 + ParseError/with_dashes.ura | 1 + ParseError/with_dots.ura | 1 + ParseError/with_quotes.ura | 1 + .../variable_not_defined_1.ura | 1 + .../variable_not_defined_2.ura | 1 + correct/array_in_object.ura | 5 + correct/array_in_object_trailing_comma.ura | 5 + correct/basic_string.ura | 7 ++ correct/bug_trailing_comma.ura | 7 ++ correct/empty.ura | 0 correct/empty_object.ura | 6 ++ correct/empty_object_2.ura | 1 + correct/empty_object_3.ura | 1 + correct/escape_sentence.ura | 2 + correct/full.ura | 102 ++++++++++++++++++ correct/importing/README.md | 5 + correct/importing/normal.ura | 5 + correct/importing/one.ura | 4 + correct/importing/three.ura | 1 + correct/importing/two.ura | 5 + correct/importing/with_variable.ura | 7 ++ correct/literal_string.ura | 7 ++ correct/multiline_basic_string.ura | 35 ++++++ correct/multiline_literal_string.ura | 9 ++ correct/nan.ura | 4 + correct/normal.ura | 37 +++++++ correct/normal_object.ura | 12 +++ correct/normal_variable.ura | 17 +++ correct/object_with_comments.ura | 26 +++++ correct/object_without_useless_line.ura | 5 + correct/unused_var.ura | 1 + correct/useless_line_in_the_middle.ura | 17 +++ correct/useless_line_in_the_middle_object.ura | 14 +++ ...less_line_in_the_middle_object_complex.ura | 24 +++++ correct/useless_line_on_both.ura | 23 ++++ correct/useless_line_on_bottom.ura | 16 +++ correct/useless_line_on_top.ura | 15 +++ correct/with_comments.ura | 52 +++++++++ correct/without_useless_line.ura | 8 ++ 64 files changed, 542 insertions(+) create mode 100644 DuplicatedImportError/duplicated_imports_simple.ura create mode 100644 DuplicatedKeyError/README.md create mode 100644 DuplicatedKeyError/duplicated_key.ura create mode 100644 DuplicatedKeyError/duplicated_key_aux_1.ura create mode 100644 DuplicatedKeyError/duplicated_key_aux_2.ura create mode 100644 DuplicatedVariableError/README.md create mode 100644 DuplicatedVariableError/duplicated_variable.ura create mode 100644 DuplicatedVariableError/duplicated_variable_1.ura create mode 100644 DuplicatedVariableError/duplicated_variable_aux_1.ura create mode 100644 DuplicatedVariableError/duplicated_variable_aux_2.ura create mode 100644 FileNotFoundError/file_not_found.ura create mode 100644 InvalidIndentationError/different_chars.ura create mode 100644 InvalidIndentationError/invalid_object_indentation.ura create mode 100644 InvalidIndentationError/more_than_4_difference.ura create mode 100644 InvalidIndentationError/not_divisible_by_4.ura create mode 100644 InvalidIndentationError/with_tabs.ura create mode 100644 ParseError/invalid_import_1.ura create mode 100644 ParseError/invalid_import_2.ura create mode 100644 ParseError/invalid_object_1.ura create mode 100644 ParseError/invalid_object_2.ura create mode 100644 ParseError/invalid_variable_definition_1.ura create mode 100644 ParseError/invalid_variable_definition_2.ura create mode 100644 ParseError/invalid_variable_definition_3.ura create mode 100644 ParseError/invalid_variable_definition_4.ura create mode 100644 ParseError/invalid_variable_with_object.ura create mode 100644 ParseError/with_dashes.ura create mode 100644 ParseError/with_dots.ura create mode 100644 ParseError/with_quotes.ura create mode 100644 VariableNotDefinedError/variable_not_defined_1.ura create mode 100644 VariableNotDefinedError/variable_not_defined_2.ura create mode 100644 correct/array_in_object.ura create mode 100644 correct/array_in_object_trailing_comma.ura create mode 100644 correct/basic_string.ura create mode 100644 correct/bug_trailing_comma.ura create mode 100644 correct/empty.ura create mode 100644 correct/empty_object.ura create mode 100644 correct/empty_object_2.ura create mode 100644 correct/empty_object_3.ura create mode 100644 correct/escape_sentence.ura create mode 100644 correct/full.ura create mode 100644 correct/importing/README.md create mode 100644 correct/importing/normal.ura create mode 100644 correct/importing/one.ura create mode 100644 correct/importing/three.ura create mode 100644 correct/importing/two.ura create mode 100644 correct/importing/with_variable.ura create mode 100644 correct/literal_string.ura create mode 100644 correct/multiline_basic_string.ura create mode 100644 correct/multiline_literal_string.ura create mode 100644 correct/nan.ura create mode 100644 correct/normal.ura create mode 100644 correct/normal_object.ura create mode 100644 correct/normal_variable.ura create mode 100644 correct/object_with_comments.ura create mode 100644 correct/object_without_useless_line.ura create mode 100644 correct/unused_var.ura create mode 100644 correct/useless_line_in_the_middle.ura create mode 100644 correct/useless_line_in_the_middle_object.ura create mode 100644 correct/useless_line_in_the_middle_object_complex.ura create mode 100644 correct/useless_line_on_both.ura create mode 100644 correct/useless_line_on_bottom.ura create mode 100644 correct/useless_line_on_top.ura create mode 100644 correct/with_comments.ura create mode 100644 correct/without_useless_line.ura diff --git a/DuplicatedImportError/duplicated_imports_simple.ura b/DuplicatedImportError/duplicated_imports_simple.ura new file mode 100644 index 0000000..a60acfe --- /dev/null +++ b/DuplicatedImportError/duplicated_imports_simple.ura @@ -0,0 +1,2 @@ +import "tests/importing/tests-files/duplicated_variable_aux_1.ura" +import "tests/importing/tests-files/duplicated_variable_aux_1.ura" \ No newline at end of file diff --git a/DuplicatedKeyError/README.md b/DuplicatedKeyError/README.md new file mode 100644 index 0000000..4d9f828 --- /dev/null +++ b/DuplicatedKeyError/README.md @@ -0,0 +1,3 @@ +# DuplicatedKeyError tests + +The entry point tests is the file `duplicated_key.ura` that imports some of the files in this directory. \ No newline at end of file diff --git a/DuplicatedKeyError/duplicated_key.ura b/DuplicatedKeyError/duplicated_key.ura new file mode 100644 index 0000000..4b44a73 --- /dev/null +++ b/DuplicatedKeyError/duplicated_key.ura @@ -0,0 +1,3 @@ +# Both have defined a key called "my_value" +import "tests/importing/tests-files/duplicated_key_aux_1.ura" +import "tests/importing/tests-files/duplicated_key_aux_2.ura" \ No newline at end of file diff --git a/DuplicatedKeyError/duplicated_key_aux_1.ura b/DuplicatedKeyError/duplicated_key_aux_1.ura new file mode 100644 index 0000000..68e34e0 --- /dev/null +++ b/DuplicatedKeyError/duplicated_key_aux_1.ura @@ -0,0 +1 @@ +my_value: 10 \ No newline at end of file diff --git a/DuplicatedKeyError/duplicated_key_aux_2.ura b/DuplicatedKeyError/duplicated_key_aux_2.ura new file mode 100644 index 0000000..68e34e0 --- /dev/null +++ b/DuplicatedKeyError/duplicated_key_aux_2.ura @@ -0,0 +1 @@ +my_value: 10 \ No newline at end of file diff --git a/DuplicatedVariableError/README.md b/DuplicatedVariableError/README.md new file mode 100644 index 0000000..ebffeb9 --- /dev/null +++ b/DuplicatedVariableError/README.md @@ -0,0 +1,3 @@ +# DuplicatedVariableError tests + +The entry point tests are files `duplicated_variable_1.ura` and `duplicated_variable.ura` (this last one imports some of the files in this directory). \ No newline at end of file diff --git a/DuplicatedVariableError/duplicated_variable.ura b/DuplicatedVariableError/duplicated_variable.ura new file mode 100644 index 0000000..64dee5a --- /dev/null +++ b/DuplicatedVariableError/duplicated_variable.ura @@ -0,0 +1,3 @@ +# Both have defined a variable called "$my_variable" +import "tests/importing/tests-files/duplicated_variable_aux_1.ura" +import "tests/importing/tests-files/duplicated_variable_aux_2.ura" \ No newline at end of file diff --git a/DuplicatedVariableError/duplicated_variable_1.ura b/DuplicatedVariableError/duplicated_variable_1.ura new file mode 100644 index 0000000..634161b --- /dev/null +++ b/DuplicatedVariableError/duplicated_variable_1.ura @@ -0,0 +1 @@ +$a_var: 14\n$a_var: 15 \ No newline at end of file diff --git a/DuplicatedVariableError/duplicated_variable_aux_1.ura b/DuplicatedVariableError/duplicated_variable_aux_1.ura new file mode 100644 index 0000000..b9ad9d8 --- /dev/null +++ b/DuplicatedVariableError/duplicated_variable_aux_1.ura @@ -0,0 +1 @@ +$my_variable: 1 \ No newline at end of file diff --git a/DuplicatedVariableError/duplicated_variable_aux_2.ura b/DuplicatedVariableError/duplicated_variable_aux_2.ura new file mode 100644 index 0000000..69e255a --- /dev/null +++ b/DuplicatedVariableError/duplicated_variable_aux_2.ura @@ -0,0 +1 @@ +$my_variable: 2 \ No newline at end of file diff --git a/FileNotFoundError/file_not_found.ura b/FileNotFoundError/file_not_found.ura new file mode 100644 index 0000000..e434385 --- /dev/null +++ b/FileNotFoundError/file_not_found.ura @@ -0,0 +1 @@ +import "invalid_file.ura" \ No newline at end of file diff --git a/InvalidIndentationError/different_chars.ura b/InvalidIndentationError/different_chars.ura new file mode 100644 index 0000000..f5ee157 --- /dev/null +++ b/InvalidIndentationError/different_chars.ura @@ -0,0 +1,3 @@ +testing: + test: true # Spaces + test_2: false # Tab \ No newline at end of file diff --git a/InvalidIndentationError/invalid_object_indentation.ura b/InvalidIndentationError/invalid_object_indentation.ura new file mode 100644 index 0000000..cfa3771 --- /dev/null +++ b/InvalidIndentationError/invalid_object_indentation.ura @@ -0,0 +1,7 @@ +user1: + name: "Carlos" + surname: "Gardel" + +user2: + name: # INVALID + surname: "Troilo" \ No newline at end of file diff --git a/InvalidIndentationError/more_than_4_difference.ura b/InvalidIndentationError/more_than_4_difference.ura new file mode 100644 index 0000000..5ec05af --- /dev/null +++ b/InvalidIndentationError/more_than_4_difference.ura @@ -0,0 +1,5 @@ +# INVALID as second level has block of 8 spaces as indentation +services: + nginx: + host: "127.0.0.1" + port: 80 \ No newline at end of file diff --git a/InvalidIndentationError/not_divisible_by_4.ura b/InvalidIndentationError/not_divisible_by_4.ura new file mode 100644 index 0000000..1bd632e --- /dev/null +++ b/InvalidIndentationError/not_divisible_by_4.ura @@ -0,0 +1,2 @@ +testing: + test: true \ No newline at end of file diff --git a/InvalidIndentationError/with_tabs.ura b/InvalidIndentationError/with_tabs.ura new file mode 100644 index 0000000..ab5cd47 --- /dev/null +++ b/InvalidIndentationError/with_tabs.ura @@ -0,0 +1,2 @@ +user: + name: "Gura" \ No newline at end of file diff --git a/ParseError/invalid_import_1.ura b/ParseError/invalid_import_1.ura new file mode 100644 index 0000000..1d944f2 --- /dev/null +++ b/ParseError/invalid_import_1.ura @@ -0,0 +1 @@ + import "another_file.ura" \ No newline at end of file diff --git a/ParseError/invalid_import_2.ura b/ParseError/invalid_import_2.ura new file mode 100644 index 0000000..00b3450 --- /dev/null +++ b/ParseError/invalid_import_2.ura @@ -0,0 +1 @@ +import "another_file.ura" \ No newline at end of file diff --git a/ParseError/invalid_object_1.ura b/ParseError/invalid_object_1.ura new file mode 100644 index 0000000..23a7f7a --- /dev/null +++ b/ParseError/invalid_object_1.ura @@ -0,0 +1 @@ +user1: diff --git a/ParseError/invalid_object_2.ura b/ParseError/invalid_object_2.ura new file mode 100644 index 0000000..0721029 --- /dev/null +++ b/ParseError/invalid_object_2.ura @@ -0,0 +1,3 @@ +test: + "invalid object" + test_2: 5 \ No newline at end of file diff --git a/ParseError/invalid_variable_definition_1.ura b/ParseError/invalid_variable_definition_1.ura new file mode 100644 index 0000000..b0d73d8 --- /dev/null +++ b/ParseError/invalid_variable_definition_1.ura @@ -0,0 +1 @@ +$invalid: true \ No newline at end of file diff --git a/ParseError/invalid_variable_definition_2.ura b/ParseError/invalid_variable_definition_2.ura new file mode 100644 index 0000000..eb1d6d3 --- /dev/null +++ b/ParseError/invalid_variable_definition_2.ura @@ -0,0 +1 @@ +$invalid: false \ No newline at end of file diff --git a/ParseError/invalid_variable_definition_3.ura b/ParseError/invalid_variable_definition_3.ura new file mode 100644 index 0000000..a56553b --- /dev/null +++ b/ParseError/invalid_variable_definition_3.ura @@ -0,0 +1 @@ +$invalid: null \ No newline at end of file diff --git a/ParseError/invalid_variable_definition_4.ura b/ParseError/invalid_variable_definition_4.ura new file mode 100644 index 0000000..e746fc1 --- /dev/null +++ b/ParseError/invalid_variable_definition_4.ura @@ -0,0 +1 @@ +$invalid: [ 1, 2, 3] \ No newline at end of file diff --git a/ParseError/invalid_variable_with_object.ura b/ParseError/invalid_variable_with_object.ura new file mode 100644 index 0000000..b6db083 --- /dev/null +++ b/ParseError/invalid_variable_with_object.ura @@ -0,0 +1,3 @@ +# INVALID, objects are not allowed as a variable value +$invalid: user: + name: 'Invalid user' \ No newline at end of file diff --git a/ParseError/with_dashes.ura b/ParseError/with_dashes.ura new file mode 100644 index 0000000..ed3b630 --- /dev/null +++ b/ParseError/with_dashes.ura @@ -0,0 +1 @@ +with-dashes: 5 \ No newline at end of file diff --git a/ParseError/with_dots.ura b/ParseError/with_dots.ura new file mode 100644 index 0000000..c91c9a1 --- /dev/null +++ b/ParseError/with_dots.ura @@ -0,0 +1 @@ +with.dot: 5 \ No newline at end of file diff --git a/ParseError/with_quotes.ura b/ParseError/with_quotes.ura new file mode 100644 index 0000000..22bbe19 --- /dev/null +++ b/ParseError/with_quotes.ura @@ -0,0 +1 @@ +"with_quotes": 5 \ No newline at end of file diff --git a/VariableNotDefinedError/variable_not_defined_1.ura b/VariableNotDefinedError/variable_not_defined_1.ura new file mode 100644 index 0000000..aeab48d --- /dev/null +++ b/VariableNotDefinedError/variable_not_defined_1.ura @@ -0,0 +1 @@ +test: "$false_var" \ No newline at end of file diff --git a/VariableNotDefinedError/variable_not_defined_2.ura b/VariableNotDefinedError/variable_not_defined_2.ura new file mode 100644 index 0000000..0e10855 --- /dev/null +++ b/VariableNotDefinedError/variable_not_defined_2.ura @@ -0,0 +1 @@ +test: $false_var \ No newline at end of file diff --git a/correct/array_in_object.ura b/correct/array_in_object.ura new file mode 100644 index 0000000..0d62a7b --- /dev/null +++ b/correct/array_in_object.ura @@ -0,0 +1,5 @@ +model: + columns: [ + [ "var1", "str" ], + [ "var2", "str" ] + ] \ No newline at end of file diff --git a/correct/array_in_object_trailing_comma.ura b/correct/array_in_object_trailing_comma.ura new file mode 100644 index 0000000..34d47b3 --- /dev/null +++ b/correct/array_in_object_trailing_comma.ura @@ -0,0 +1,5 @@ +model: + columns: [ + [ "var1", "str" ], + [ "var2", "str" ], + ] \ No newline at end of file diff --git a/correct/basic_string.ura b/correct/basic_string.ura new file mode 100644 index 0000000..4719636 --- /dev/null +++ b/correct/basic_string.ura @@ -0,0 +1,7 @@ +$name: "Gura" + +str: "I'm a string. \"You can quote me\". Na\bme\tJos\u00E9\nLocation\tSF." +str_2: "I'm a string. \"You can quote me\". Na\bme\tJos\U000000E9\nLocation\tSF." +with_var: "$name is cool" +escaped_var: "\$name is cool" +with_env_var: "$name is $env_var_value cool" # $env_var_value is defined in corresponding test.py \ No newline at end of file diff --git a/correct/bug_trailing_comma.ura b/correct/bug_trailing_comma.ura new file mode 100644 index 0000000..46424e1 --- /dev/null +++ b/correct/bug_trailing_comma.ura @@ -0,0 +1,7 @@ +foo: [ + bar: + baz: [ + far: "faz" + ], +] +barbaz: "boo" \ No newline at end of file diff --git a/correct/empty.ura b/correct/empty.ura new file mode 100644 index 0000000..e69de29 diff --git a/correct/empty_object.ura b/correct/empty_object.ura new file mode 100644 index 0000000..b7738ad --- /dev/null +++ b/correct/empty_object.ura @@ -0,0 +1,6 @@ +# COMMMENT +empty_object: empty + + + +# COMMENT \ No newline at end of file diff --git a/correct/empty_object_2.ura b/correct/empty_object_2.ura new file mode 100644 index 0000000..48b3d85 --- /dev/null +++ b/correct/empty_object_2.ura @@ -0,0 +1 @@ +empty_object: empty \ No newline at end of file diff --git a/correct/empty_object_3.ura b/correct/empty_object_3.ura new file mode 100644 index 0000000..70d83d2 --- /dev/null +++ b/correct/empty_object_3.ura @@ -0,0 +1 @@ +empty_object: empty \ No newline at end of file diff --git a/correct/escape_sentence.ura b/correct/escape_sentence.ura new file mode 100644 index 0000000..da9899d --- /dev/null +++ b/correct/escape_sentence.ura @@ -0,0 +1,2 @@ +# Should be interpreted as \t\\h\\i\\i +foo: "\t\h\i\\i" \ No newline at end of file diff --git a/correct/full.ura b/correct/full.ura new file mode 100644 index 0000000..9a2cdf3 --- /dev/null +++ b/correct/full.ura @@ -0,0 +1,102 @@ +a_string: "test string" +int1: +99 +int2: 42 +int3: 0 +int4: -17 +int5: 1_000 +int6: 5_349_221 +int7: 53_49_221 # Indian number system grouping +# Hexadecimal with prefix `0x` +hex1: 0xDEADBEEF +hex2: 0xdeadbeef +hex3: 0xdead_beef + +# Octal with prefix `0o` +oct1: 0o01234567 +oct2: 0o755 # useful for Unix file permissions + +# Binary with prefix `0b` +bin1: 0b11010110 + +# Fractional +flt1: +1.0 +flt2: 3.1415 +flt3: -0.01 + +# Exponent +flt4: 5e+22 +flt5: 1e06 +flt6: -2E-2 + +# Both +flt7: 6.626e-34 +flt8: 224_617.445_991_228 + +# Infinity +sf1: inf # Positive infinity +sf2: +inf # Positive infinity +sf3: -inf # Negative infinity + +# Null +null: null + +# Empty objects +empty_single: empty + +# Bool +bool1: true +bool2: false + +# Digits as key +1234: "1234" + +# Object +services: + nginx: + host: "127.0.0.1" + port: 80 + + apache: + virtual_host: "10.10.10.4" + port: 81 + +# Arrays +integers: [ 1, 2, 3 ] +colors: [ "red", "yellow", "green" ] +nested_arrays_of_ints: [ [ 1, 2 ], [3, 4, 5] ] +nested_mixed_array: [ [ 1, 2 ], ["a", "b", "c"] ] + +# Mixed-type arrays +numbers: [ 0.1, 0.2, 0.5, 1, 2, 5 ] +tango_singers: [ + user1: + name: "Carlos" + surname: "Gardel" + year_of_birth: 1890, + user2: + name: "Aníbal" + surname: "Troilo" + year_of_birth: 1914 +] + +integers2: [ + 1, 2, 3 +] + +integers3: [ + 1, + 2, # Trailing comma +] + + +$my_string_var: "127.0.0.1" +$my_integer_var: 8080 + +my_server: + host: $my_string_var + empty_nested: empty + port: $my_integer_var + native_auth: true + +$name: "Gura" +gura_is_cool: "$name is cool" \ No newline at end of file diff --git a/correct/importing/README.md b/correct/importing/README.md new file mode 100644 index 0000000..bc756ac --- /dev/null +++ b/correct/importing/README.md @@ -0,0 +1,5 @@ +## Importing tests + +This folder contains related tests of [Gura imports functionality][imports]. The entry points are the files `normal.ura` and `with_variable` that import the other files in this directory. + +[imports]: https://gura.netlify.app/docs/spec#imports \ No newline at end of file diff --git a/correct/importing/normal.ura b/correct/importing/normal.ura new file mode 100644 index 0000000..ea60346 --- /dev/null +++ b/correct/importing/normal.ura @@ -0,0 +1,5 @@ +import "tests/importing/tests-files/one.ura" +import "tests/importing/tests-files/two.ura" + +from_original_1: [1, 2, 5] +from_original_2: false \ No newline at end of file diff --git a/correct/importing/one.ura b/correct/importing/one.ura new file mode 100644 index 0000000..453201e --- /dev/null +++ b/correct/importing/one.ura @@ -0,0 +1,4 @@ +import "three.ura" + +from_file_one: 1 + diff --git a/correct/importing/three.ura b/correct/importing/three.ura new file mode 100644 index 0000000..034a401 --- /dev/null +++ b/correct/importing/three.ura @@ -0,0 +1 @@ +from_file_three: true \ No newline at end of file diff --git a/correct/importing/two.ura b/correct/importing/two.ura new file mode 100644 index 0000000..07c4e78 --- /dev/null +++ b/correct/importing/two.ura @@ -0,0 +1,5 @@ + +from_file_two: + name: "Aníbal" + surname: "Troilo" + year_of_birth: 1914 diff --git a/correct/importing/with_variable.ura b/correct/importing/with_variable.ura new file mode 100644 index 0000000..5b7be28 --- /dev/null +++ b/correct/importing/with_variable.ura @@ -0,0 +1,7 @@ +$common_path: "tests/importing/tests-files" + +import "$common_path/one.ura" +import "$common_path/two.ura" + +from_original_1: [1, 2, 5] +from_original_2: false \ No newline at end of file diff --git a/correct/literal_string.ura b/correct/literal_string.ura new file mode 100644 index 0000000..e99c781 --- /dev/null +++ b/correct/literal_string.ura @@ -0,0 +1,7 @@ +# What you see is what you get. +winpath: 'C:\Users\nodejs\templates' +winpath2: '\\ServerX\admin$\system32\' +quoted: 'John "Dog lover" Wick' +regex: '<\i\c*\s*>' +with_var: '$no_parsed variable!' +escaped_var: '$name is cool' \ No newline at end of file diff --git a/correct/multiline_basic_string.ura b/correct/multiline_basic_string.ura new file mode 100644 index 0000000..ae24532 --- /dev/null +++ b/correct/multiline_basic_string.ura @@ -0,0 +1,35 @@ +$roses: "Roses" + +str: """ +Roses are red +Violets are blue""" + +str_2: """Roses are red +Violets are blue""" + +str_3: """Roses are red\nViolets are blue""" + +with_var: """ +$roses are red +Violets are blue""" + +with_env_var: """$env_var_value_multiline are red\nViolets are blue""" # $env_var_value_multiline is defined in corresponding test.py + + +str_with_backslash: """ +The quick brown \ + + + fox jumps over \ + the lazy dog.""" + +str_with_backslash_2: """\ + The quick brown \ + fox jumps over \ + the lazy dog.\ + """ + +str_4: """Here are two quotation marks: "". Simple enough.""" +str_5: """Here are three quotation marks: ""\".""" +str_6: """Here are fifteen quotation marks: ""\"""\"""\"""\"""\".""" +escaped_var: """\$name is cool""" \ No newline at end of file diff --git a/correct/multiline_literal_string.ura b/correct/multiline_literal_string.ura new file mode 100644 index 0000000..50ec1f9 --- /dev/null +++ b/correct/multiline_literal_string.ura @@ -0,0 +1,9 @@ +regex2: '''I [dw]on't need \d{2} apples''' +lines: ''' +The first newline is +trimmed in raw strings. + All other whitespace + is preserved. +''' +with_var: '''$no_parsed variable!''' +escaped_var: '''$name is cool''' \ No newline at end of file diff --git a/correct/nan.ura b/correct/nan.ura new file mode 100644 index 0000000..4ba5da7 --- /dev/null +++ b/correct/nan.ura @@ -0,0 +1,4 @@ +# Not a number +sf4: nan +sf5: +nan +sf6: -nan \ No newline at end of file diff --git a/correct/normal.ura b/correct/normal.ura new file mode 100644 index 0000000..5abbdd3 --- /dev/null +++ b/correct/normal.ura @@ -0,0 +1,37 @@ +integers: [ 1, 2, 3 ] +colors: [ "red", "yellow", "green" ] +nested_arrays_of_ints: [ [ 1, 2 ], [3, 4, 5] ] +nested_mixed_array: [ [ 1, 2 ], ["a", "b", "c"] ] +mixed_with_object: [ + 1, + test: + genaro: "Camele", + 2, + [ 4, 5, 6], + 3 +] +numbers: [ 0.1, 0.2, 0.5, 1, 2, 5 ] +tango_singers: [ + user1: + name: "Carlos" + surname: "Gardel" + year_of_birth: 1890 + testing_nested: + nested_1: 1 + nested_2: 2, + user2: + name: "Aníbal" + surname: "Troilo" + year_of_birth: 1914 +] +integers_with_new_line: [ + 1, + 2, + 3 +] +separator: [ + a: 1 + b: 2, + a: 1, + b: 2 +] \ No newline at end of file diff --git a/correct/normal_object.ura b/correct/normal_object.ura new file mode 100644 index 0000000..53e50de --- /dev/null +++ b/correct/normal_object.ura @@ -0,0 +1,12 @@ +user1: + name: "Carlos" + surname: "Gardel" + testing_nested: + nested_1: 1 + nested_2: 2 + year_of_birth: 1890 + +user2: + name: "Aníbal" + surname: "Troilo" + year_of_birth: 1914 diff --git a/correct/normal_variable.ura b/correct/normal_variable.ura new file mode 100644 index 0000000..bc9d9ea --- /dev/null +++ b/correct/normal_variable.ura @@ -0,0 +1,17 @@ +$my_var: 5 + +plain: $my_var +in_array_middle: [1, $my_var, 3] +in_array_last: [1, 2, $my_var] + +$name: "Aníbal" +$surname: "Troilo" +$year_of_birth: 1914 + +# Assigning variable value to another variable is allowed +$aux: $name + +in_object: + name: $aux + surname: $surname + year_of_birth: $year_of_birth \ No newline at end of file diff --git a/correct/object_with_comments.ura b/correct/object_with_comments.ura new file mode 100644 index 0000000..be3a909 --- /dev/null +++ b/correct/object_with_comments.ura @@ -0,0 +1,26 @@ +# COMMENT +user1: + name: "Carlos" + + + # COMMENT + surname: "Gardel" + year_of_birth: 1890 + + + + testing_nested: + nested_1: 1 + nested_2: 2 + + + # COMMENT +user2: # COMMENT + name: "Aníbal" + + # COMMENT + surname: "Troilo" + year_of_birth: 1914 + + + diff --git a/correct/object_without_useless_line.ura b/correct/object_without_useless_line.ura new file mode 100644 index 0000000..ffb62ab --- /dev/null +++ b/correct/object_without_useless_line.ura @@ -0,0 +1,5 @@ +testing: + test: + name: "JWARE" + surname: "Solutions" + test_2: 2 \ No newline at end of file diff --git a/correct/unused_var.ura b/correct/unused_var.ura new file mode 100644 index 0000000..dd82160 --- /dev/null +++ b/correct/unused_var.ura @@ -0,0 +1 @@ +$unused_var: 5 \ No newline at end of file diff --git a/correct/useless_line_in_the_middle.ura b/correct/useless_line_in_the_middle.ura new file mode 100644 index 0000000..b085f7e --- /dev/null +++ b/correct/useless_line_in_the_middle.ura @@ -0,0 +1,17 @@ +a_string: "test string" +int1: +99 +int2: 42 +int3: 0 + +# Some test comments + + +# Another comment + + + + +int4: -17 +int5: 1_000 +int6: 5_349_221 +int7: 53_49_221 \ No newline at end of file diff --git a/correct/useless_line_in_the_middle_object.ura b/correct/useless_line_in_the_middle_object.ura new file mode 100644 index 0000000..2ebf01b --- /dev/null +++ b/correct/useless_line_in_the_middle_object.ura @@ -0,0 +1,14 @@ +testing: + test: + # COMMENT + name: "JWARE" + +# COMMENT + + + surname: "Solutions" + + + + test_2: 2 + diff --git a/correct/useless_line_in_the_middle_object_complex.ura b/correct/useless_line_in_the_middle_object_complex.ura new file mode 100644 index 0000000..eb64c97 --- /dev/null +++ b/correct/useless_line_in_the_middle_object_complex.ura @@ -0,0 +1,24 @@ +testing: + test: + # COMMENT + name: "JWARE" + +# COMMENT + + + surname: "Solutions" + skills: + good_testing: false +# COMMENT WITHOUT BLANKS + good_programming: false + # COMMENT WITH BLANKS + good_english: false + + test_2: 2 + test_3: +# COMMENT + key_1: true + key_2: false + + key_3: 55.99 + diff --git a/correct/useless_line_on_both.ura b/correct/useless_line_on_both.ura new file mode 100644 index 0000000..71f100c --- /dev/null +++ b/correct/useless_line_on_both.ura @@ -0,0 +1,23 @@ +# Some test comments + + +# Another comment + + + +a_string: "test string" +int1: +99 +int2: 42 +int3: 0 +int4: -17 +int5: 1_000 +int6: 5_349_221 +int7: 53_49_221 + +# Some test comments + + +# Another comment + + + diff --git a/correct/useless_line_on_bottom.ura b/correct/useless_line_on_bottom.ura new file mode 100644 index 0000000..141660b --- /dev/null +++ b/correct/useless_line_on_bottom.ura @@ -0,0 +1,16 @@ +a_string: "test string" +int1: +99 +int2: 42 +int3: 0 +int4: -17 +int5: 1_000 +int6: 5_349_221 +int7: 53_49_221 + +# Some test comments + + +# Another comment + + + diff --git a/correct/useless_line_on_top.ura b/correct/useless_line_on_top.ura new file mode 100644 index 0000000..7946083 --- /dev/null +++ b/correct/useless_line_on_top.ura @@ -0,0 +1,15 @@ +# Some test comments + + +# Another comment + + + +a_string: "test string" +int1: +99 +int2: 42 +int3: 0 +int4: -17 +int5: 1_000 +int6: 5_349_221 +int7: 53_49_221 \ No newline at end of file diff --git a/correct/with_comments.ura b/correct/with_comments.ura new file mode 100644 index 0000000..39a04ba --- /dev/null +++ b/correct/with_comments.ura @@ -0,0 +1,52 @@ +# COMMENT +integers: [ 1, 2, 3 ] +colors: [ "red", "yellow", "green" ] +nested_arrays_of_ints: [ [ 1, 2 ], [3, 4, 5] ] + +# COMMENT + + +nested_mixed_array: [ [ 1, 2 ], ["a", "b", "c"] ] +mixed_with_object: [ + 1, + + test: + # COMMENT + genaro: "Camele", + 2, + [ 4, 5, 6], + 3 +] +numbers: [ 0.1, 0.2, 0.5, 1, 2, 5 ] +tango_singers: [ + user1: + name: "Carlos" + surname: "Gardel" + year_of_birth: 1890 +# COMMENT + testing_nested: + nested_1: 1 + nested_2: 2, + user2: + name: "Aníbal" + surname: "Troilo" + year_of_birth: 1914 +# COMMENT +] +integers_with_new_line: [ + 1, +# COMMENT + 2, + + + + 3 +] +separator: [ + a: 1 + b: 2 + # COMMENT + , + a: 1, + b: 2 +] \ No newline at end of file diff --git a/correct/without_useless_line.ura b/correct/without_useless_line.ura new file mode 100644 index 0000000..844724c --- /dev/null +++ b/correct/without_useless_line.ura @@ -0,0 +1,8 @@ +a_string: "test string" +int1: +99 +int2: 42 +int3: 0 +int4: -17 +int5: 1_000 +int6: 5_349_221 +int7: 53_49_221 \ No newline at end of file