Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.

Commit efef2a7

Browse files
committed
Add test verifying we strip null bytes
After discussion with @tomplex, for @seamusabshere.
1 parent 904e405 commit efef2a7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/tests.rs

+11
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,17 @@ fn null_normalization() {
141141
assert_eq!(output.stdout_str(), "a,b,c,d,e\n,,,,not null\n")
142142
}
143143

144+
#[test]
145+
fn null_normalization_of_null_bytes() {
146+
let testdir = TestDir::new("scrubcsv", "null_normalization_of_null_bytes");
147+
let output = testdir
148+
.cmd()
149+
.args(&["--null", "\\x00"])
150+
.output_with_stdin("a,b\n\0,\n")
151+
.expect_success();
152+
assert_eq!(output.stdout_str(), "a,b\n,\n")
153+
}
154+
144155
#[test]
145156
fn replace_newlines() {
146157
let testdir = TestDir::new("scrubcsv", "replace_newlines");

0 commit comments

Comments
 (0)