@@ -22,11 +22,12 @@ testCases(endToEnd, code => code)('end-to-end tests', [
2222 [ '{{{}}}' , either . makeRight ( { 0 : { 0 : { } } } ) ] ,
2323 [ '"hello world"' , either . makeRight ( 'hello world' ) ] ,
2424 [ '{foo:bar}' , either . makeRight ( { foo : 'bar' } ) ] ,
25+ [ '{hi}' , either . makeRight ( { 0 : 'hi' } ) ] ,
2526 [ '{a,b,c}' , either . makeRight ( { 0 : 'a' , 1 : 'b' , 2 : 'c' } ) ] ,
2627 [ '{,a,b,c,}' , either . makeRight ( { 0 : 'a' , 1 : 'b' , 2 : 'c' } ) ] ,
2728 [ '{a,1:overwritten,c}' , either . makeRight ( { 0 : 'a' , 1 : 'c' } ) ] ,
2829 [ '{overwritten,0:a,c}' , either . makeRight ( { 0 : 'a' , 1 : 'c' } ) ] ,
29- [ '{@check type:true value:true}' , either . makeRight ( 'true' ) ] ,
30+ [ '{@check, type:true, value:true}' , either . makeRight ( 'true' ) ] ,
3031 [
3132 '{@panic}' ,
3233 result => {
@@ -36,17 +37,17 @@ testCases(endToEnd, code => code)('end-to-end tests', [
3637 } ,
3738 ] ,
3839 [
39- '{@runtime _ => {@panic}}' ,
40+ '{@runtime, _ => {@panic}}' ,
4041 result => {
4142 assert ( either . isLeft ( result ) )
4243 assert ( 'kind' in result . value )
4344 assert . deepEqual ( result . value . kind , 'panic' )
4445 } ,
4546 ] ,
46- [ '{a:A b:{@lookup a}}' , either . makeRight ( { a : 'A' , b : 'A' } ) ] ,
47- [ '{a:A b: :a}' , either . makeRight ( { a : 'A' , b : 'A' } ) ] ,
48- [ '{a:A {@lookup a}}' , either . makeRight ( { a : 'A' , 0 : 'A' } ) ] ,
49- [ '{a:A :a}' , either . makeRight ( { a : 'A' , 0 : 'A' } ) ] ,
47+ [ '{a:A, b:{@lookup, a}}' , either . makeRight ( { a : 'A' , b : 'A' } ) ] ,
48+ [ '{a:A, b: :a}' , either . makeRight ( { a : 'A' , b : 'A' } ) ] ,
49+ [ '{a:A, {@lookup, a}}' , either . makeRight ( { a : 'A' , 0 : 'A' } ) ] ,
50+ [ '{a:A, :a}' , either . makeRight ( { a : 'A' , 0 : 'A' } ) ] ,
5051 [ '{ a: (a => :a)(A) }' , either . makeRight ( { a : 'A' } ) ] ,
5152 [ '{ a: ( a => :a )( A ) }' , either . makeRight ( { a : 'A' } ) ] ,
5253 [ '(a => :a)(A)' , either . makeRight ( 'A' ) ] ,
@@ -101,7 +102,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
101102 c: z => {
102103 d: y => x => {
103104 e: {
104- f: w => { g: { :z :y :x :w } }
105+ f: w => { g: { :z, :y, :x, :w, } }
105106 }
106107 }
107108 }
@@ -116,13 +117,12 @@ testCases(endToEnd, code => code)('end-to-end tests', [
116117 [ '{ ("a"): A }' , either . makeRight ( { a : 'A' } ) ] ,
117118 [ '{ a: :(b), b: B }' , either . makeRight ( { a : 'B' , b : 'B' } ) ] ,
118119 [ '{ a: :("b"), b: B }' , either . makeRight ( { a : 'B' , b : 'B' } ) ] ,
119- [ '{ (a: A) (b: B) }' , either . makeRight ( { a : 'A' , b : 'B' } ) ] ,
120- [ '( { ((a): :(b)) ( ( b ): B ) } )' , either . makeRight ( { a : 'B' , b : 'B' } ) ] ,
120+ [ '{ (a: A), (b: B) }' , either . makeRight ( { a : 'A' , b : 'B' } ) ] ,
121+ [ '( { ((a): :(b)), ( ( b ): B ) } )' , either . makeRight ( { a : 'B' , b : 'B' } ) ] ,
121122 [ '{ (a: :(")")), (")": (B)) }' , either . makeRight ( { a : 'B' , ')' : 'B' } ) ] ,
122123 [ `/**/a/**/` , either . makeRight ( 'a' ) ] ,
123124 [ 'hello//world' , either . makeRight ( 'hello' ) ] ,
124125 [ `"hello//world"` , either . makeRight ( 'hello//world' ) ] ,
125- [ `{a/* this works as a delimiter */b}` , either . makeRight ( { 0 : 'a' , 1 : 'b' } ) ] ,
126126 [
127127 `/**/{/**/a:/**/b/**/,/**/c:/**/d/**/}/**/` ,
128128 either . makeRight ( { a : 'b' , c : 'd' } ) ,
@@ -133,7 +133,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
133133 ] ,
134134 [ ':match({ a: A })({ tag: a, value: {} })' , either . makeRight ( 'A' ) ] ,
135135 [ ':atom.prepend(a)(b)' , either . makeRight ( 'ab' ) ] ,
136- [ ':flow({ :atom.append(a) :atom.append(b) })(z)' , either . makeRight ( 'zab' ) ] ,
136+ [ ':flow({ :atom.append(a), :atom.append(b) })(z)' , either . makeRight ( 'zab' ) ] ,
137137 [
138138 `{
139139 // foo: bar
@@ -142,7 +142,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
142142 0:@runtime
143143 function:{
144144 0:@apply
145- function:{0:@index object:{0:@lookup key:object} query:{0:lookup}}
145+ function:{0:@index, object:{0:@lookup, key:object}, query:{0:lookup}}
146146 argument:"key which does not exist in runtime context"
147147 }
148148 }
@@ -159,15 +159,15 @@ testCases(endToEnd, code => code)('end-to-end tests', [
159159 either . makeRight ( { tag : 'none' , value : { } } ) ,
160160 ] ,
161161 [
162- `{@runtime {@apply :flow {
163- {@apply :object.lookup environment}
164- {@apply :match {
162+ `{@runtime, {@apply, :flow, {
163+ {@apply, :object.lookup, environment}
164+ {@apply, :match, {
165165 none: "environment does not exist"
166- some: {@apply :flow {
167- {@apply :object.lookup lookup}
168- {@apply :match {
166+ some: {@apply, :flow, {
167+ {@apply, :object.lookup, lookup}
168+ {@apply, :match, {
169169 none: "environment.lookup does not exist"
170- some: {@apply :apply PATH}
170+ some: {@apply, :apply, PATH}
171171 }}
172172 }}
173173 }}
@@ -182,7 +182,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
182182 } ,
183183 ] ,
184184 [
185- `{@runtime :flow({
185+ `{@runtime, :flow({
186186 :object.lookup(environment)
187187 :match({
188188 none: "environment does not exist"
@@ -205,7 +205,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
205205 } ,
206206 ] ,
207207 [
208- `{@runtime context =>
208+ `{@runtime, context =>
209209 :identity(:context).program.start_time
210210 }` ,
211211 output => {
@@ -216,7 +216,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
216216 } ,
217217 ] ,
218218 [
219- `{@runtime context =>
219+ `{@runtime, context =>
220220 :context.environment.lookup(PATH)
221221 }` ,
222222 output => {
@@ -265,8 +265,8 @@ testCases(endToEnd, code => code)('end-to-end tests', [
265265 either . makeRight ( { true : 'true' , false : 'false' } ) ,
266266 ] ,
267267 [
268- `{@runtime context =>
269- {@if :boolean.not(:boolean.is(:context))
268+ `{@runtime, context =>
269+ {@if, :boolean.not(:boolean.is(:context))
270270 "it works!"
271271 {@panic}
272272 }
@@ -275,7 +275,8 @@ testCases(endToEnd, code => code)('end-to-end tests', [
275275 ] ,
276276 [
277277 `{
278- fibonacci: n => {@if :integer.less_than(2)(:n)
278+ fibonacci: n => {
279+ @if, :integer.less_than(2)(:n)
279280 then: :n
280281 else: :integer.add(
281282 :fibonacci(:integer.subtract(2)(:n))
0 commit comments