diff --git a/src/protocol/tests/lexer.rs b/src/protocol/tests/lexer.rs index 25d3fba7df135b5e72b6d1325f45b1b316fb7e66..dcc200336d1929477428880c13c0e9e1b63538e3 100644 --- a/src/protocol/tests/lexer.rs +++ b/src/protocol/tests/lexer.rs @@ -9,7 +9,7 @@ use super::*; fn test_disallowed_inference() { Tester::new_single_source_expect_err( "argument auto inference", - "int func(auto arg) { return 0; }" + "s32 func(auto arg) { return 0; }" ).error(|e| { e .assert_msg_has(0, "inference is not allowed") .assert_occurs_at(0, "auto arg"); @@ -17,7 +17,7 @@ fn test_disallowed_inference() { Tester::new_single_source_expect_err( "return type auto inference", - "auto func(int arg) { return 0; }" + "auto func(s32 arg) { return 0; }" ).error(|e| { e .assert_msg_has(0, "inference is not allowed") .assert_occurs_at(0, "auto func"); @@ -25,7 +25,7 @@ fn test_disallowed_inference() { Tester::new_single_source_expect_err( "implicit polymorph argument auto inference", - "int func(in port) { return port; }" + "s32 func(in port) { return port; }" ).error(|e| { e .assert_msg_has(0, "inference is not allowed") .assert_occurs_at(0, "in port"); @@ -33,7 +33,7 @@ fn test_disallowed_inference() { Tester::new_single_source_expect_err( "explicit polymorph argument auto inference", - "int func(in port) { return port; }" + "s32 func(in port) { return port; }" ).error(|e| { e .assert_msg_has(0, "inference is not allowed") .assert_occurs_at(0, "auto> port"); @@ -65,45 +65,45 @@ fn test_simple_struct_definition() { Tester::new_single_source_expect_ok( "single field, no comma", - "struct Foo{ int field }" + "struct Foo{ s32 field }" ).for_struct("Foo", |t| { t .assert_num_fields(1) .for_field("field", |f| { - f.assert_parser_type("int"); + f.assert_parser_type("s32"); }); }); Tester::new_single_source_expect_ok( "single field, with comma", - "struct Foo{ int field, }" + "struct Foo{ s32 field, }" ).for_struct("Foo", |t| { t .assert_num_fields(1) .for_field("field", |f| { f - .assert_parser_type("int"); + .assert_parser_type("s32"); }); }); Tester::new_single_source_expect_ok( "multiple fields, no comma", - "struct Foo{ byte a, short b, int c }" + "struct Foo{ u8 a, s16 b, s32 c }" ).for_struct("Foo", |t| { t .assert_num_fields(3) - .for_field("a", |f| { f.assert_parser_type("byte"); }) - .for_field("b", |f| { f.assert_parser_type("short"); }) - .for_field("c", |f| { f.assert_parser_type("int"); }); + .for_field("a", |f| { f.assert_parser_type("u8"); }) + .for_field("b", |f| { f.assert_parser_type("s16"); }) + .for_field("c", |f| { f.assert_parser_type("s32"); }); }); Tester::new_single_source_expect_ok( "multiple fields, with comma", "struct Foo{ - byte a, - short b, - int c, + u8 a, + s16 b, + s32 c, }" ).for_struct("Foo", |t| { t .assert_num_fields(3) - .for_field("a", |f| { f.assert_parser_type("byte"); }) - .for_field("b", |f| { f.assert_parser_type("short"); }) - .for_field("c", |f| { f.assert_parser_type("int"); }); + .for_field("a", |f| { f.assert_parser_type("u8"); }) + .for_field("b", |f| { f.assert_parser_type("s16"); }) + .for_field("c", |f| { f.assert_parser_type("s32"); }); }); } \ No newline at end of file