aboutsummaryrefslogtreecommitdiffstats
path: root/test/testdata/eval-fail-fromTOML-timestamps.nix
diff options
context:
space:
mode:
Diffstat (limited to 'test/testdata/eval-fail-fromTOML-timestamps.nix')
-rw-r--r--test/testdata/eval-fail-fromTOML-timestamps.nix130
1 files changed, 130 insertions, 0 deletions
diff --git a/test/testdata/eval-fail-fromTOML-timestamps.nix b/test/testdata/eval-fail-fromTOML-timestamps.nix
new file mode 100644
index 0000000..74cff94
--- /dev/null
+++ b/test/testdata/eval-fail-fromTOML-timestamps.nix
@@ -0,0 +1,130 @@
1builtins.fromTOML ''
2 key = "value"
3 bare_key = "value"
4 bare-key = "value"
5 1234 = "value"
6
7 "127.0.0.1" = "value"
8 "character encoding" = "value"
9 "ʎǝʞ" = "value"
10 'key2' = "value"
11 'quoted "value"' = "value"
12
13 name = "Orange"
14
15 physical.color = "orange"
16 physical.shape = "round"
17 site."google.com" = true
18
19 # This is legal according to the spec, but cpptoml doesn't handle it.
20 #a.b.c = 1
21 #a.d = 2
22
23 str = "I'm a string. \"You can quote me\". Name\tJos\u00E9\nLocation\tSF."
24
25 int1 = +99
26 int2 = 42
27 int3 = 0
28 int4 = -17
29 int5 = 1_000
30 int6 = 5_349_221
31 int7 = 1_2_3_4_5
32
33 hex1 = 0xDEADBEEF
34 hex2 = 0xdeadbeef
35 hex3 = 0xdead_beef
36
37 oct1 = 0o01234567
38 oct2 = 0o755
39
40 bin1 = 0b11010110
41
42 flt1 = +1.0
43 flt2 = 3.1415
44 flt3 = -0.01
45 flt4 = 5e+22
46 flt5 = 1e6
47 flt6 = -2E-2
48 flt7 = 6.626e-34
49 flt8 = 9_224_617.445_991_228_313
50
51 bool1 = true
52 bool2 = false
53
54 odt1 = 1979-05-27T07:32:00Z
55 odt2 = 1979-05-27T00:32:00-07:00
56 odt3 = 1979-05-27T00:32:00.999999-07:00
57 odt4 = 1979-05-27 07:32:00Z
58 ldt1 = 1979-05-27T07:32:00
59 ldt2 = 1979-05-27T00:32:00.999999
60 ld1 = 1979-05-27
61 lt1 = 07:32:00
62 lt2 = 00:32:00.999999
63
64 arr1 = [ 1, 2, 3 ]
65 arr2 = [ "red", "yellow", "green" ]
66 arr3 = [ [ 1, 2 ], [3, 4, 5] ]
67 arr4 = [ "all", 'strings', """are the same""", ''''type'''']
68 arr5 = [ [ 1, 2 ], ["a", "b", "c"] ]
69
70 arr7 = [
71 1, 2, 3
72 ]
73
74 arr8 = [
75 1,
76 2, # this is ok
77 ]
78
79 [table-1]
80 key1 = "some string"
81 key2 = 123
82
83
84 [table-2]
85 key1 = "another string"
86 key2 = 456
87
88 [dog."tater.man"]
89 type.name = "pug"
90
91 [a.b.c]
92 [ d.e.f ]
93 [ g . h . i ]
94 [ j . "ʞ" . 'l' ]
95 [x.y.z.w]
96
97 name = { first = "Tom", last = "Preston-Werner" }
98 point = { x = 1, y = 2 }
99 animal = { type.name = "pug" }
100
101 [[products]]
102 name = "Hammer"
103 sku = 738594937
104
105 [[products]]
106
107 [[products]]
108 name = "Nail"
109 sku = 284758393
110 color = "gray"
111
112 [[fruit]]
113 name = "apple"
114
115 [fruit.physical]
116 color = "red"
117 shape = "round"
118
119 [[fruit.variety]]
120 name = "red delicious"
121
122 [[fruit.variety]]
123 name = "granny smith"
124
125 [[fruit]]
126 name = "banana"
127
128 [[fruit.variety]]
129 name = "plantain"
130''