@@ -375,11 +375,11 @@ def test_mangle_functype(params, results, expect):
375
375
376
376
test_mangle_functype ([U8 ()], [U8 ()], 'func u8 -> u8' )
377
377
test_mangle_functype ([U8 ()], [], 'func u8 -> ()' )
378
- test_mangle_functype ([], [U8 ()], 'func () -> u8' )
379
- test_mangle_functype ([('x' ,U8 ())], [('y' ,U8 ())], 'func (x: u8) -> (y: u8)' )
378
+ test_mangle_functype ([], [U8 ()], 'func() -> u8' )
379
+ test_mangle_functype ([('x' ,U8 ())], [('y' ,U8 ())], 'func(x: u8) -> (y: u8)' )
380
380
test_mangle_functype ([('a' ,Bool ()),('b' ,U8 ()),('c' ,S16 ()),('d' ,U32 ()),('e' ,S64 ())],
381
381
[('a' ,S8 ()),('b' ,U16 ()),('c' ,S32 ()),('d' ,U64 ())],
382
- 'func (a: bool, b: u8, c: s16, d: u32, e: s64) -> (a: s8, b: u16, c: s32, d: u64)' )
382
+ 'func(a: bool, b: u8, c: s16, d: u32, e: s64) -> (a: s8, b: u16, c: s32, d: u64)' )
383
383
test_mangle_functype ([List (List (String ()))], [],
384
384
'func list<list<string>> -> ()' )
385
385
test_mangle_functype ([Record ([Field ('x' ,Record ([Field ('y' ,String ())])),Field ('z' ,U32 ())])], [],
@@ -393,7 +393,7 @@ def test_mangle_functype(params, results, expect):
393
393
test_mangle_functype ([Option (Bool ())],[Option (List (U8 ()))],
394
394
'func option<bool> -> option<list<u8>>' )
395
395
test_mangle_functype ([], [('a' ,Result (None ,None )),('b' ,Result (U8 (),None )),('c' ,Result (None ,U8 ()))],
396
- 'func () -> (a: result<_, _>, b: result<u8, _>, c: result<_, u8>)' )
396
+ 'func() -> (a: result<_, _>, b: result<u8, _>, c: result<_, u8>)' )
397
397
398
398
def test_cabi (ct , expect ):
399
399
got = canonical_module_type (ct )
@@ -411,7 +411,7 @@ def test_cabi(ct, expect):
411
411
[CoreImportDecl ('' ,'a: func u8 -> u8' , CoreFuncType (['i32' ],['i32' ]))],
412
412
[CoreExportDecl ('cabi_memory' , CoreMemoryType (0 , None )),
413
413
CoreExportDecl ('cabi_realloc' , CoreFuncType (['i32' ,'i32' ,'i32' ,'i32' ],['i32' ])),
414
- CoreExportDecl ('cabi_start{cabi=0.1}: func (b: string) -> (d: list<u8>)' ,
414
+ CoreExportDecl ('cabi_start{cabi=0.1}: func(b: string) -> (d: list<u8>)' ,
415
415
CoreFuncType (['i32' ,'i32' ],['i32' ])),
416
416
CoreExportDecl ('c: func s8 -> s8' , CoreFuncType (['i32' ],['i32' ]))]
417
417
)
@@ -431,9 +431,9 @@ def test_cabi(ct, expect):
431
431
[CoreImportDecl ('' ,'a.b: func u8 -> u8' , CoreFuncType (['i32' ],['i32' ]))],
432
432
[CoreExportDecl ('cabi_memory' , CoreMemoryType (0 , None )),
433
433
CoreExportDecl ('cabi_realloc' , CoreFuncType (['i32' ,'i32' ,'i32' ,'i32' ],['i32' ])),
434
- CoreExportDecl ('cabi_start{cabi=0.1}: func (a.c: float32) -> (d.f: float64)' ,
434
+ CoreExportDecl ('cabi_start{cabi=0.1}: func(a.c: float32) -> (d.f: float64)' ,
435
435
CoreFuncType (['f32' ],['f64' ])),
436
- CoreExportDecl ('d.e: func () -> list<string>' , CoreFuncType ([],['i32' ])),
436
+ CoreExportDecl ('d.e: func() -> list<string>' , CoreFuncType ([],['i32' ])),
437
437
CoreExportDecl ('cabi_post_d.e' , CoreFuncType (['i32' ],[]))]
438
438
)
439
439
)
@@ -444,17 +444,17 @@ def test_cabi(ct, expect):
444
444
ExternDecl ('bar' , FuncType ([('x' , U32 ()),('y' , U32 ())],[U32 ()]))
445
445
])),
446
446
ExternDecl ('v1' , ValueType (String ()))],
447
- [ExternDecl ('baz' , FuncType ([], [String ()])),
447
+ [ExternDecl ('baz' , FuncType ([String () ], [String ()])),
448
448
ExternDecl ('v2' , ValueType (List (List (String ()))))]
449
449
),
450
450
ModuleType (
451
- [CoreImportDecl ('' ,'foo: func () -> ()' , CoreFuncType ([],[])),
452
- CoreImportDecl ('' ,'a.bar: func (x: u32, y: u32) -> u32' , CoreFuncType (['i32' ,'i32' ],['i32' ]))],
451
+ [CoreImportDecl ('' ,'foo: func() -> ()' , CoreFuncType ([],[])),
452
+ CoreImportDecl ('' ,'a.bar: func(x: u32, y: u32) -> u32' , CoreFuncType (['i32' ,'i32' ],['i32' ]))],
453
453
[CoreExportDecl ('cabi_memory' , CoreMemoryType (0 , None )),
454
454
CoreExportDecl ('cabi_realloc' , CoreFuncType (['i32' ,'i32' ,'i32' ,'i32' ],['i32' ])),
455
- CoreExportDecl ('cabi_start{cabi=0.1}: func (v1: string) -> (v2: list<list<string>>)' ,
455
+ CoreExportDecl ('cabi_start{cabi=0.1}: func(v1: string) -> (v2: list<list<string>>)' ,
456
456
CoreFuncType (['i32' ,'i32' ],['i32' ])),
457
- CoreExportDecl ('baz: func () -> string' , CoreFuncType ([],['i32' ])),
457
+ CoreExportDecl ('baz: func string -> string' , CoreFuncType (['i32' , 'i32' ],['i32' ])),
458
458
CoreExportDecl ('cabi_post_baz' , CoreFuncType (['i32' ],[]))]
459
459
)
460
460
)
0 commit comments