@@ -28,9 +28,9 @@ testCases(endToEnd, code => code)('end-to-end tests', [
2828 [ '{,a,b,c,}' , either . makeRight ( { 0 : 'a' , 1 : 'b' , 2 : 'c' } ) ] ,
2929 [ '{a,1:overwritten,c}' , either . makeRight ( { 0 : 'a' , 1 : 'c' } ) ] ,
3030 [ '{overwritten,0:a,c}' , either . makeRight ( { 0 : 'a' , 1 : 'c' } ) ] ,
31- [ '{" @check", {type:true, value:true} }' , either . makeRight ( 'true' ) ] ,
31+ [ '@check {type:true, value:true}' , either . makeRight ( 'true' ) ] ,
3232 [
33- '{" @panic"} ' ,
33+ '@panic' ,
3434 result => {
3535 assert ( either . isLeft ( result ) )
3636 assert ( 'kind' in result . value )
@@ -42,7 +42,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
4242 [ '{a:A, b: :a}' , either . makeRight ( { a : 'A' , b : 'A' } ) ] ,
4343 [ '{a:A, :a}' , either . makeRight ( { a : 'A' , 0 : 'A' } ) ] ,
4444 [
45- '{" @runtime", {_ => {" @panic"}} }' ,
45+ '@runtime {_ => @panic}' ,
4646 result => {
4747 assert ( either . isLeft ( result ) )
4848 assert ( 'kind' in result . value )
@@ -153,9 +153,9 @@ testCases(endToEnd, code => code)('end-to-end tests', [
153153 ] ,
154154 [ ':match({ a: A })({ tag: a, value: {} })' , either . makeRight ( 'A' ) ] ,
155155 [
156- `{" @runtime", { context =>
156+ `@runtime { context =>
157157 :identity(:context).program.start_time
158- }} ` ,
158+ }` ,
159159 output => {
160160 if ( either . isLeft ( output ) ) {
161161 assert . fail ( output . value . message )
@@ -181,9 +181,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
181181 [ `(1 - 2) - 3` , either . makeRight ( '-4' ) ] ,
182182 [ ':flow(:atom.append(b))(:atom.append(a))(z)' , either . makeRight ( 'zab' ) ] ,
183183 [
184- `{"@runtime"
185- { :object.lookup("key which does not exist in runtime context") }
186- }` ,
184+ `@runtime { :object.lookup("key which does not exist in runtime context") }` ,
187185 either . makeRight ( { tag : 'none' , value : { } } ) ,
188186 ] ,
189187 [
@@ -213,7 +211,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
213211 either . makeRight ( { true : 'true' , false : 'false' } ) ,
214212 ] ,
215213 [
216- `{" @runtime", {
214+ `@runtime {
217215 :flow(
218216 :match({
219217 none: "environment does not exist"
@@ -228,7 +226,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
228226 })
229227 )(
230228 :object.lookup(environment)
231- )}
229+ )
232230 }` ,
233231 output => {
234232 if ( either . isLeft ( output ) ) {
@@ -260,9 +258,9 @@ testCases(endToEnd, code => code)('end-to-end tests', [
260258 either . makeRight ( { 0 : 'a' , 1 : 'b' , 2 : 'c' , 3 : 'd' } ) ,
261259 ] ,
262260 [
263- `{" @runtime", { context =>
261+ `@runtime { context =>
264262 :context.environment.lookup(PATH)
265- }} ` ,
263+ }` ,
266264 output => {
267265 if ( either . isLeft ( output ) ) {
268266 assert . fail ( output . value . message )
@@ -273,11 +271,11 @@ testCases(endToEnd, code => code)('end-to-end tests', [
273271 } ,
274272 ] ,
275273 [
276- `{" @if", {
274+ `@if {
277275 true
278276 "it works!"
279- {" @panic"}
280- }} ` ,
277+ @panic
278+ }` ,
281279 either . makeRight ( 'it works!' ) ,
282280 ] ,
283281 [
@@ -289,24 +287,23 @@ testCases(endToEnd, code => code)('end-to-end tests', [
289287 either . makeRight ( { 0 : 'a' , 1 : 'b' , 2 : 'c' } ) ,
290288 ] ,
291289 [
292- `{" @runtime", { context =>
293- {" @if", {
290+ `@runtime { context =>
291+ @if {
294292 :boolean.not(:boolean.is(:context))
295293 "it works!"
296- {" @panic"}
297- }}
298- }} ` ,
294+ @panic
295+ }
296+ }` ,
299297 either . makeRight ( 'it works!' ) ,
300298 ] ,
301299 [
302300 `{
303- fibonacci: n => {
304- " @if", {
301+ fibonacci: n =>
302+ @if {
305303 :integer.less_than(2)(:n)
306304 then: :n
307305 else: :fibonacci(:n - 1) + :fibonacci(:n - 2)
308306 }
309- }
310307 result: :fibonacci(10)
311308 }.result` ,
312309 either . makeRight ( '55' ) ,
@@ -362,7 +359,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
362359 either . makeRight ( '2' ) ,
363360 ] ,
364361 [
365- `{" @runtime", { context =>
362+ `@runtime { context =>
366363 (
367364 PATH
368365 |> :context.environment.lookup
@@ -371,7 +368,7 @@ testCases(endToEnd, code => code)('end-to-end tests', [
371368 some: :atom.prepend("PATH=")
372369 })
373370 )
374- }} ` ,
371+ }` ,
375372 result => {
376373 if ( either . isLeft ( result ) ) {
377374 assert . fail ( result . value . message )
0 commit comments