]> git.lizzy.rs Git - rust.git/commitdiff
Add first test for std::vec::Vec.
authorScott Olson <scott@solson.me>
Mon, 21 Mar 2016 02:18:09 +0000 (20:18 -0600)
committerScott Olson <scott@solson.me>
Mon, 21 Mar 2016 02:18:09 +0000 (20:18 -0600)
test/heap.rs
test/vecs.rs [new file with mode: 0755]

index c40165909df02335044ad4e7b7145ca0a0d8eb57..05efc56f0f33e2a74e473e9118d41083e478f414 100755 (executable)
@@ -10,8 +10,3 @@ fn make_box() -> Box<(i16, i16)> {
 fn make_box_syntax() -> Box<(i16, i16)> {
     box (1, 2)
 }
-
-// #[miri_run]
-// fn make_vec() -> Vec<i32> {
-//     Vec::new()
-// }
diff --git a/test/vecs.rs b/test/vecs.rs
new file mode 100755 (executable)
index 0000000..e3cb67b
--- /dev/null
@@ -0,0 +1,15 @@
+#![feature(custom_attribute)]
+#![allow(dead_code, unused_attributes)]
+
+#[miri_run]
+fn make_vec() -> Vec<i32> {
+    let v = Vec::with_capacity(4);
+    v.push(1);
+    v.push(2);
+    v
+}
+
+// #[miri_run]
+// fn make_vec_macro() -> Vec<i32> {
+//     vec![1, 2]
+// }