From b714f0e84bfd3e9ac205752d51420015230b8c40 Mon Sep 17 00:00:00 2001 From: Vic Nightfall Date: Mon, 6 May 2024 11:42:25 +0200 Subject: [PATCH] Fix test --- test/test_parser.pr | 84 ++++++++++++++++++++++++++++++--------------- 1 file changed, 56 insertions(+), 28 deletions(-) diff --git a/test/test_parser.pr b/test/test_parser.pr index d908b82..21f2a10 100644 --- a/test/test_parser.pr +++ b/test/test_parser.pr @@ -1279,22 +1279,30 @@ def #test test_pointer_types { } }""")) - assert parse("(type weak_ref)") == program(json::parse(""" { + assert parse("(type weak &)") == program(json::parse("""{ "kind": "WeakRefT", "kw": "VAR", - "tpe": null + "tpe": { + "kind": "RefT", + "kw": "VAR", + "tpe": null + } }""")) assert parse("(type weak &T)") == program(json::parse("""{ "kind": "WeakRefT", "kw": "VAR", "tpe": { - "kind": "Identifier", - "path": [ - "T" - ], - "prefixed": false, - "args": null + "kind": "RefT", + "kw": "VAR", + "tpe": { + "kind": "Identifier", + "path": [ + "T" + ], + "prefixed": false, + "args": null + } } }""")) @@ -1302,20 +1310,7 @@ def #test test_pointer_types { "kind": "WeakRefT", "kw": "VAR", "tpe": { - "kind": "Identifier", - "path": [ - "T" - ], - "prefixed": false, - "args": null - } - }""")) - - assert parse("(type weak &let *T)") == program(json::parse("""{ - "kind": "WeakRefT", - "kw": "LET", - "tpe": { - "kind": "PtrT", + "kind": "RefT", "kw": "VAR", "tpe": { "kind": "Identifier", @@ -1328,22 +1323,55 @@ def #test test_pointer_types { } }""")) - assert parse("(type weak &)") == program(json::parse(""" { + assert parse("(type weak &let *T)") == program(json::parse(""" { "kind": "WeakRefT", "kw": "VAR", - "tpe": null + "tpe": { + "kind": "RefT", + "kw": "LET", + "tpe": { + "kind": "PtrT", + "kw": "VAR", + "tpe": { + "kind": "Identifier", + "path": [ + "T" + ], + "prefixed": false, + "args": null + } + } + } + }""")) + + assert parse("(type weak &)") == program(json::parse("""{ + "kind": "WeakRefT", + "kw": "VAR", + "tpe": { + "kind": "RefT", + "kw": "VAR", + "tpe": null + } }""")) assert parse("(type weak &let)") == program(json::parse("""{ "kind": "WeakRefT", - "kw": "LET", - "tpe": null + "kw": "VAR", + "tpe": { + "kind": "RefT", + "kw": "LET", + "tpe": null + } }""")) - assert parse("(type weak &var)") == program(json::parse(""" { + assert parse("(type weak &var)") == program(json::parse("""{ "kind": "WeakRefT", "kw": "VAR", - "tpe": null + "tpe": { + "kind": "RefT", + "kw": "VAR", + "tpe": null + } }""")) }