commit 85c24e9bfe3d698e04c5e7a6d29ab082e413da52
parent a19882fbe33d120b44645cc084d96cf73858fabe
Author: Sebastian <sebastian@sebsite.pw>
Date: Wed, 23 Feb 2022 15:09:17 -0500
parse: use `raw strings` in tests
Signed-off-by: Sebastian <sebastian@sebsite.pw>
Diffstat:
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/hare/parse/+test/expr.ha b/hare/parse/+test/expr.ha
@@ -43,7 +43,7 @@
};
@test fn builtin() void = {
- roundtrip("export fn main() void = {
+ roundtrip(`export fn main() void = {
alloc(1234);
alloc(4321, 1234);
append(x, 10);
@@ -52,13 +52,13 @@
append(x, y, z, q...);
static append(x, 10);
abort();
- abort(\"surprize\");
+ abort("surprize");
static abort();
- static abort(\"surprize\");
+ static abort("surprize");
assert(x == 12);
- assert(x == 12, \"number mismatch\");
+ assert(x == 12, "number mismatch");
static assert(x == 12);
- static assert(x == 12, \"number mismatch\");
+ static assert(x == 12, "number mismatch");
delete(x[10]);
delete(x[10..20]);
delete(x[..]);
@@ -73,7 +73,7 @@
offset(foo.bar);
size(u32);
};
-");
+`);
};
@test fn call() void = {
@@ -92,8 +92,8 @@
};
@test fn constant() void = {
- roundtrip("export fn main() void = {
- 2 + (-4 + void) * true / (\"hello\" << '?');
+ roundtrip(`export fn main() void = {
+ 2 + (-4 + void) * true / ("hello" << '?');
[1, 2, 3, 4];
[1, 2, 3, 4...];
(1, 2, 3);
@@ -147,7 +147,7 @@
1337i64;
1337u64;
};
-");
+`);
};
@test fn control() void = {
diff --git a/hare/parse/+test/loc.ha b/hare/parse/+test/loc.ha
@@ -38,8 +38,8 @@ fn expr_testloc(srcs: str...) void = for (let i = 0z; i < len(srcs); i += 1) {
expr_testloc("foo", "foo[bar]", "foo.bar", "foo.1");
expr_testloc("alloc(foo)");
expr_testloc("append(foo, bar)", "append(foo, bar, baz)");
- expr_testloc("assert(foo)", "assert(foo, \"bar\")", "abort()",
- "abort(\"foo\")");
+ expr_testloc("assert(foo)", `assert(foo, "bar")`, "abort()",
+ `abort("foo")`);
expr_testloc("foo = bar");
expr_testloc("foo * bar");
expr_testloc("let foo: bar = baz", "let foo: bar = baz, quux = quuux",
@@ -50,7 +50,7 @@ fn expr_testloc(srcs: str...) void = for (let i = 0z; i < len(srcs); i += 1) {
expr_testloc("[foo, bar]", "[foo, bar...]");
expr_testloc("foo { bar = baz, ... }", "struct { foo: bar = baz, }");
expr_testloc("(foo, bar)");
- expr_testloc("null", "void", "true", "\"שלום\"");
+ expr_testloc("null", "void", "true", `"שלום"`);
expr_testloc("continue :foo");
expr_testloc("defer foo");
expr_testloc("delete(foo[bar])", "delete(foo[bar..baz])");