diff options
Diffstat (limited to 'contrib/libucl/tests/basic')
-rw-r--r-- | contrib/libucl/tests/basic/18.in | 21 | ||||
-rw-r--r-- | contrib/libucl/tests/basic/18.res | 15 | ||||
-rw-r--r-- | contrib/libucl/tests/basic/2.res | 2 | ||||
-rw-r--r-- | contrib/libucl/tests/basic/9.in | 13 | ||||
-rw-r--r-- | contrib/libucl/tests/basic/9.res | 29 | ||||
-rw-r--r-- | contrib/libucl/tests/basic/escapes.in | 2 | ||||
-rw-r--r-- | contrib/libucl/tests/basic/escapes.res | 2 | ||||
-rw-r--r-- | contrib/libucl/tests/basic/load.in | 14 | ||||
-rw-r--r-- | contrib/libucl/tests/basic/load.inc | 2 | ||||
-rw-r--r-- | contrib/libucl/tests/basic/load.res | 19 |
10 files changed, 116 insertions, 3 deletions
diff --git a/contrib/libucl/tests/basic/18.in b/contrib/libucl/tests/basic/18.in index bd12c019859a..9b5655afc25a 100644 --- a/contrib/libucl/tests/basic/18.in +++ b/contrib/libucl/tests/basic/18.in @@ -7,4 +7,25 @@ defaults { mything { .inherit "defaults" key = "newval" + key = "newval1" +} +mything { + .inherit "mything" + key = "newval" +} +.priority 3 + +defaults { + key = "val1" + foo = "bar1" + many = "values here" +} +mything1 { + key2 = "wtf??" + .priority 1 + .inherit "defaults" + .inherit "mything" + .inherit "mything1" + key1 = "newval" + key2 = "OMG" # low priority } diff --git a/contrib/libucl/tests/basic/18.res b/contrib/libucl/tests/basic/18.res index a6272d508ac5..92bf0f8e8840 100644 --- a/contrib/libucl/tests/basic/18.res +++ b/contrib/libucl/tests/basic/18.res @@ -1,5 +1,11 @@ defaults { - key = "val"; + key = "val1"; + foo = "bar1"; + many = "values here"; +} +mything { + key = "newval"; + key = "newval1"; foo = "bar"; many = "values here"; } @@ -8,4 +14,11 @@ mything { foo = "bar"; many = "values here"; } +mything1 { + key2 = "wtf??"; + key = "val1"; + foo = "bar1"; + many = "values here"; + key1 = "newval"; +} diff --git a/contrib/libucl/tests/basic/2.res b/contrib/libucl/tests/basic/2.res index 72e95705ec46..cac7a243ccc6 100644 --- a/contrib/libucl/tests/basic/2.res +++ b/contrib/libucl/tests/basic/2.res @@ -29,7 +29,7 @@ key4 = 5000000; key4 = "s1"; key5 = 0.010000; key5 = "\n\r123"; -key6 = 2207520000.000000; +key6 = 315360000.0; keyvar = "unknowntest"; keyvar = "unknownunknownunknown${unknown}"; keyvar = "${some}$no${}$$test$$$$$$$"; diff --git a/contrib/libucl/tests/basic/9.in b/contrib/libucl/tests/basic/9.in index 4c06e39dcaeb..2341445edbf0 100644 --- a/contrib/libucl/tests/basic/9.in +++ b/contrib/libucl/tests/basic/9.in @@ -6,7 +6,18 @@ key = value; .include "$CURDIR/9.inc" -.try_include "/non/existent" #.try_include "$CURDIR/9.incorrect.inc" # 9.incorrect.inc contains '{}}' #key = value; +prefix1 = { + key = value +} +array = [10] +array1 = [10] +.include(prefix=true; key="prefix") "$CURDIR/9.inc" +.include(prefix=true; key="prefix2"; target="array"; glob=true) "$CURDIR/9.inc" +.include(prefix=true; key="prefix1"; target="array"; glob=true) "$CURDIR/9.inc" +.include(prefix=true; key="array"; target="array"; glob=true) "$CURDIR/9.inc" +.include(prefix=true; key="array1"; glob=true) "$CURDIR/9.inc" +.include(prefix=true; key="prefix"; glob=true) "$CURDIR/9.inc" +.try_include "/non/existent" diff --git a/contrib/libucl/tests/basic/9.res b/contrib/libucl/tests/basic/9.res index ec3f014e60d4..0ed36e84422a 100644 --- a/contrib/libucl/tests/basic/9.res +++ b/contrib/libucl/tests/basic/9.res @@ -2,4 +2,33 @@ key1 = "value"; key1 = "value"; key1 = "value"; key = "value"; +prefix1 [ + { + key = "value"; + } + { + key1 = "value"; + } +] +array [ + 10, + { + key1 = "value"; + } +] +array1 [ + 10, + { + key1 = "value"; + } +] +prefix { + key1 = "value"; + key1 = "value"; +} +prefix2 [ + { + key1 = "value"; + } +] diff --git a/contrib/libucl/tests/basic/escapes.in b/contrib/libucl/tests/basic/escapes.in new file mode 100644 index 000000000000..d9da67a3fd53 --- /dev/null +++ b/contrib/libucl/tests/basic/escapes.in @@ -0,0 +1,2 @@ +# Checks for escapes in strings +str = "\r\n\b\t\f\\\"\u03B4\u0B90\u1F640\uFFFFsome text" diff --git a/contrib/libucl/tests/basic/escapes.res b/contrib/libucl/tests/basic/escapes.res new file mode 100644 index 000000000000..e914e778ff7d --- /dev/null +++ b/contrib/libucl/tests/basic/escapes.res @@ -0,0 +1,2 @@ +str = "\r\n\b\t\f\\\"δஐὤ0some text"; + diff --git a/contrib/libucl/tests/basic/load.in b/contrib/libucl/tests/basic/load.in new file mode 100644 index 000000000000..3ed4cee9a0d9 --- /dev/null +++ b/contrib/libucl/tests/basic/load.in @@ -0,0 +1,14 @@ +# Load macro tests +section { + +.load(try=false, multiline=false, trim=false, escape=false, key="key1", target="string", priority=1) "${CURDIR}/load.inc" +.load(try=false, multiline=true, trim=false, escape=false, key="key2", target="string", priority=1) "${CURDIR}/load.inc" +.load(try=false, multiline=true, trim=true, escape=false, key="key3", target="string", priority=1) "${CURDIR}/load.inc" +.load(try=false, multiline=true, trim=true, escape=true, key="key4", target="string", priority=1) "${CURDIR}/load.inc" +.load(try=false, multiline=false, trim=true, escape=false, key="key5", target="string", priority=1) "${CURDIR}/load.inc" +.load(try=false, multiline=false, trim=false, escape=true, key="key6", target="string", priority=1) "${CURDIR}/load.inc" +.load(try=false, multiline=false, trim=true, escape=true, key="key7", target="string", priority=1) "${CURDIR}/load.inc" +.load(try=false, multiline=false, trim=false, escape=false, key="key8", target="int", priority=1) "${CURDIR}/load.inc" +.load(try=false, multiline=false, trim=false, escape=false, key="key9", target="int", priority=4) "${CURDIR}/load.inc" +.load(try=true, multiline=false, trim=false, escape=false, key="key10", target="string", priority=1) "load_bad.inc" +}; diff --git a/contrib/libucl/tests/basic/load.inc b/contrib/libucl/tests/basic/load.inc new file mode 100644 index 000000000000..cbd9a13b82a2 --- /dev/null +++ b/contrib/libucl/tests/basic/load.inc @@ -0,0 +1,2 @@ + 123 + 321\n diff --git a/contrib/libucl/tests/basic/load.res b/contrib/libucl/tests/basic/load.res new file mode 100644 index 000000000000..9ab1eac6b178 --- /dev/null +++ b/contrib/libucl/tests/basic/load.res @@ -0,0 +1,19 @@ +section { + key1 = " 123\n 321\\n \n"; + key2 = <<EOD + 123 + 321\n + +EOD; + key3 = <<EOD +123 + 321\n +EOD; + key4 = "123\\n 321\\\\n"; + key5 = "123\n 321\\n"; + key6 = " 123\\n 321\\\\n \\n"; + key7 = "123\\n 321\\\\n"; + key8 = 123; + key9 = 123; +} + |