-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
542 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import "tests/importing/tests-files/duplicated_variable_aux_1.ura" | ||
import "tests/importing/tests-files/duplicated_variable_aux_1.ura" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
my_value: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
my_value: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$a_var: 14\n$a_var: 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$my_variable: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$my_variable: 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "invalid_file.ura" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
testing: | ||
test: true # Spaces | ||
test_2: false # Tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
user1: | ||
name: "Carlos" | ||
surname: "Gardel" | ||
|
||
user2: | ||
name: # INVALID | ||
surname: "Troilo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# INVALID as second level has block of 8 spaces as indentation | ||
services: | ||
nginx: | ||
host: "127.0.0.1" | ||
port: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
testing: | ||
test: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
user: | ||
name: "Gura" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "another_file.ura" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import "another_file.ura" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
user1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
test: | ||
"invalid object" | ||
test_2: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$invalid: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$invalid: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$invalid: null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$invalid: [ 1, 2, 3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# INVALID, objects are not allowed as a variable value | ||
$invalid: user: | ||
name: 'Invalid user' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
with-dashes: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
with.dot: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"with_quotes": 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test: "$false_var" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test: $false_var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
model: | ||
columns: [ | ||
[ "var1", "str" ], | ||
[ "var2", "str" ] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
model: | ||
columns: [ | ||
[ "var1", "str" ], | ||
[ "var2", "str" ], | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
foo: [ | ||
bar: | ||
baz: [ | ||
far: "faz" | ||
], | ||
] | ||
barbaz: "boo" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# COMMMENT | ||
empty_object: empty | ||
|
||
|
||
|
||
# COMMENT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
empty_object: empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
empty_object: empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Should be interpreted as \t\\h\\i\\i | ||
foo: "\t\h\i\\i" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import "three.ura" | ||
|
||
from_file_one: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from_file_three: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
from_file_two: | ||
name: "Aníbal" | ||
surname: "Troilo" | ||
year_of_birth: 1914 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Not a number | ||
sf4: nan | ||
sf5: +nan | ||
sf6: -nan |
Oops, something went wrong.