aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-07-26 23:51:58 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-07-26 23:51:58 -0700
commit06c4b35eb12a54a4e260a80ed8ed21eb5bfae09a (patch)
tree33d8366daa35741ce302df23e2be1e217aa20187 /test/run_tests.cpp
parentbc81ddfea67db0b3756027e98cc00bb8fa903a20 (diff)
downloadzig-06c4b35eb12a54a4e260a80ed8ed21eb5bfae09a.tar.gz
zig-06c4b35eb12a54a4e260a80ed8ed21eb5bfae09a.zip
std: improve rand implementation and API
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index 7d5948628e..1cb7fddc3b 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -1427,6 +1427,12 @@ export inline fn foo(x: i32, y: i32) -> i32{
)SOURCE", 1, ".tmp_source.zig:2:1: error: extern functions cannot be inline");
*/
+ add_compile_fail_case("convert fixed size array to slice with invalid size", R"SOURCE(
+fn f() {
+ var array: [5]u8 = undefined;
+ var foo = ([]u32)(array)[0];
+}
+ )SOURCE", 1, ".tmp_source.zig:4:22: error: unable to convert [5]u8 to []u32: size mismatch");
}
//////////////////////////////////////////////////////////////////////////////