Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorious3 committed May 6, 2024
1 parent 60ae1ce commit b714f0e
Showing 1 changed file with 56 additions and 28 deletions.
84 changes: 56 additions & 28 deletions test/test_parser.pr
Original file line number Diff line number Diff line change
Expand Up @@ -1279,43 +1279,38 @@ 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
}
}
}"""))

assert parse("(type weak &var T)") == program(json::parse("""{
"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",
Expand All @@ -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
}
}"""))
}

Expand Down

0 comments on commit b714f0e

Please sign in to comment.