summaryrefslogtreecommitdiffstats
path: root/vendor/cstr/tests/pass/byte_str_lit.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/cstr/tests/pass/byte_str_lit.rs')
-rw-r--r--vendor/cstr/tests/pass/byte_str_lit.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/vendor/cstr/tests/pass/byte_str_lit.rs b/vendor/cstr/tests/pass/byte_str_lit.rs
new file mode 100644
index 000000000..fd87f176c
--- /dev/null
+++ b/vendor/cstr/tests/pass/byte_str_lit.rs
@@ -0,0 +1,7 @@
+use cstr::cstr;
+use std::ffi::CStr;
+
+fn main() {
+ let foo: &'static CStr = cstr!(b"foo\xffbar");
+ assert_eq!(foo, CStr::from_bytes_with_nul(b"foo\xffbar\0").unwrap());
+}