aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-04-06 14:15:20 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-04-06 14:15:20 -0700
commit57688dea36e6d1f8d7bad255898d1e222b3a6fbc (patch)
tree6aa180ef0197b047899b1b823106dd4cf838e2d0 /test/run_tests.cpp
parent7bb67b1fd0ca56a04778083f1a01583d839be9b1 (diff)
downloadzig-57688dea36e6d1f8d7bad255898d1e222b3a6fbc.tar.gz
zig-57688dea36e6d1f8d7bad255898d1e222b3a6fbc.zip
add error for gt and lt comparison of invalid types
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index fcec983db6..fb232aed70 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -1776,6 +1776,11 @@ fn f() {
const foo = "a
b";
)SOURCE", 1, ".tmp_source.zig:2:13: error: use raw string for multiline string literal");
+
+ add_compile_fail_case("invalid comparison for function pointers", R"SOURCE(
+fn foo() {}
+const invalid = foo > foo;
+ )SOURCE", 1, ".tmp_source.zig:3:21: error: operator not allowed for type 'fn()'");
}
//////////////////////////////////////////////////////////////////////////////