Skip to content

Commit 222a7d7

Browse files
Add test for files that start with /dev/null
1 parent d02c263 commit 222a7d7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/test.ml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,16 @@ let busybox_diff_quotes = {|\
880880
let busybox_diff_quotes =
881881
operations [Patch.Edit ({|foo "bar" baz|}, {|foo bar "baz"|})] busybox_diff_quotes
882882

883+
let dev_null_like = {|\
884+
--- /dev/null_but_actually_not
885+
+++ b
886+
@@ -0,0 +1 @@
887+
+foo
888+
|}
889+
890+
let dev_null_like =
891+
operations [Patch.Edit ("/dev/null_but_actually_not", "b")] dev_null_like
892+
883893
let filename_diffs =
884894
[
885895
"unified diff with spaces", `Quick, unified_diff_spaces;
@@ -888,6 +898,7 @@ let filename_diffs =
888898
"unified diff with quotes", `Quick, unified_diff_quotes;
889899
"git diff with quotes", `Quick, git_diff_quotes;
890900
"busybox diff with quotes", `Quick, busybox_diff_quotes;
901+
"file that looks like /dev/null", `Quick, dev_null_like;
891902
]
892903

893904
let tests = [

0 commit comments

Comments
 (0)