about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/tests/nonzero.rs7
-rw-r--r--src/test/run-pass/nonzero.rs16
2 files changed, 7 insertions, 16 deletions
diff --git a/src/libcore/tests/nonzero.rs b/src/libcore/tests/nonzero.rs
index 8d39298bac3..bbb1ef76bcc 100644
--- a/src/libcore/tests/nonzero.rs
+++ b/src/libcore/tests/nonzero.rs
@@ -121,3 +121,10 @@ fn test_match_nonzero_const_pattern() {
         _ => panic!("Expected the const item as a pattern to match.")
     }
 }
+
+#[test]
+fn test_from_nonzero() {
+    let nz = NonZeroU32::new(1).unwrap();
+    let num: u32 = nz.into();
+    assert_eq!(num, 1u32);
+}
diff --git a/src/test/run-pass/nonzero.rs b/src/test/run-pass/nonzero.rs
deleted file mode 100644
index 0f2b1dcc8d3..00000000000
--- a/src/test/run-pass/nonzero.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn main() {
-    use std::num::NonZeroU32;
-    let nz = NonZeroU32::new(5).unwrap();
-    let num: u32 = nz.into();
-}
-