We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c80a97b commit e33bcf7Copy full SHA for e33bcf7
1 file changed
tests/string.rs
@@ -157,3 +157,18 @@ fn test_bytes_into_iter() -> Result<()> {
157
158
Ok(())
159
}
160
+
161
+#[cfg(feature = "lua55")]
162
+#[test]
163
+fn test_external_string() -> Result<()> {
164
+ let lua = Lua::new();
165
166
+ let s = lua.create_external_string(b"abc\0")?;
167
+ assert_eq!(
168
+ s.as_bytes(),
169
+ b"abc\0",
170
+ "Trailing null byte should be preserved if present explicitly"
171
+ );
172
173
+ Ok(())
174
+}
0 commit comments