Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit d0f609e

Browse files
committed
Added an additional syctl tests for whitespace handling
1 parent 7986d77 commit d0f609e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/sysctl/tests.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ fn test_write_bool() {
2626
});
2727
}
2828

29+
#[test]
30+
fn test_write_bool_whitespace() {
31+
with_kernel_module(|| {
32+
fs::write("/proc/sys/rust/sysctl-tests/a", " 1\t").unwrap();
33+
assert_eq!(
34+
fs::read_to_string("/proc/sys/rust/sysctl-tests/a").unwrap(),
35+
"1\n"
36+
);
37+
});
38+
}
39+
2940
#[test]
3041
fn test_file_doesnt_exit_after_module_unloaded() {
3142
with_kernel_module(|| {

0 commit comments

Comments
 (0)