summaryrefslogtreecommitdiffstats
path: root/third_party/rust/generic-array/tests/arr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/generic-array/tests/arr.rs')
-rw-r--r--third_party/rust/generic-array/tests/arr.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/third_party/rust/generic-array/tests/arr.rs b/third_party/rust/generic-array/tests/arr.rs
new file mode 100644
index 0000000000..461805a501
--- /dev/null
+++ b/third_party/rust/generic-array/tests/arr.rs
@@ -0,0 +1,27 @@
+#[macro_use]
+extern crate generic_array;
+extern crate typenum;
+
+#[test]
+fn empty_without_trailing_comma() {
+ let ar = arr![u8; ];
+ assert_eq!(format!("{:x}", ar), "");
+}
+
+#[test]
+fn empty_with_trailing_comma() {
+ let ar = arr![u8; , ];
+ assert_eq!(format!("{:x}", ar), "");
+}
+
+#[test]
+fn without_trailing_comma() {
+ let ar = arr![u8; 10, 20, 30];
+ assert_eq!(format!("{:x}", ar), "0a141e");
+}
+
+#[test]
+fn with_trailing_comma() {
+ let ar = arr![u8; 10, 20, 30, ];
+ assert_eq!(format!("{:x}", ar), "0a141e");
+}