authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-01-11 18:23:19-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-01-11 18:23:19-05:00
logde9ecaf96470c9d2b9f165608a57ba03c9c0f17c
treecf2c59112ae4c93a4a1d8752fca2094d43b5c12d
parentfc53708dc0e0395e0360a4d62ed75ce66ad3c58e

fix some tests


1 files changed, 7 insertions(+), 6 deletions(-)

test/run_tests.cpp+7-6
......@@ -1452,34 +1452,35 @@ fn function_with_return_type_type() {
14521452 ".tmp_source.zig:17:19: note: called from here");
14531453
14541454 add_compile_fail_case("bogus method call on slice", R"SOURCE(
1455var self = "aoeu";
14551456fn f(m: []const u8) {
1456 m.copy(u8, self.list.items[old_len...], m);
1457 m.copy(u8, self[0...], m);
14571458}
1458 )SOURCE", 1, ".tmp_source.zig:3:6: error: no member named 'copy' in '[]const u8'");
1459 )SOURCE", 1, ".tmp_source.zig:4:6: error: no member named 'copy' in '[]const u8'");
14591460
14601461 add_compile_fail_case("wrong number of arguments for method fn call", R"SOURCE(
1461const Foo = {
1462const Foo = struct {
14621463 fn method(self: &const Foo, a: i32) {}
14631464};
14641465fn f(foo: &const Foo) {
14651466
14661467 foo.method(1, 2);
14671468}
1468 )SOURCE", 1, ".tmp_source.zig:7:15: error: expected 1 arguments, found 2");
1469 )SOURCE", 1, ".tmp_source.zig:7:15: error: expected 2 arguments, found 3");
14691470
14701471 add_compile_fail_case("assign through constant pointer", R"SOURCE(
14711472fn f() {
14721473 var cstr = c"Hat";
14731474 cstr[0] = 'W';
14741475}
1475 )SOURCE", 1, ".tmp_source.zig:4:7: error: cannot assign to constant");
1476 )SOURCE", 1, ".tmp_source.zig:4:11: error: cannot assign to constant");
14761477
14771478 add_compile_fail_case("assign through constant slice", R"SOURCE(
14781479pub fn f() {
14791480 var cstr: []const u8 = "Hat";
14801481 cstr[0] = 'W';
14811482}
1482 )SOURCE", 1, ".tmp_source.zig:4:7: error: cannot assign to constant");
1483 )SOURCE", 1, ".tmp_source.zig:4:11: error: cannot assign to constant");
14831484
14841485 add_compile_fail_case("main function with bogus args type", R"SOURCE(
14851486pub fn main(args: [][]bogus) -> %void {}