diff --git a/test/snapshot/batgrep/test_search_from_stdin.stderr.snapshot b/test/snapshot/batgrep/test_search_from_stdin.stderr.snapshot new file mode 100644 index 0000000..e69de29 diff --git a/test/snapshot/batgrep/test_search_from_stdin.stdout.snapshot b/test/snapshot/batgrep/test_search_from_stdin.stdout.snapshot new file mode 100644 index 0000000..19d2bdb --- /dev/null +++ b/test/snapshot/batgrep/test_search_from_stdin.stdout.snapshot @@ -0,0 +1,7 @@ +──────────────────────────────────────────────────────────────────────────────── +cat +dog +car +frog +fox +──────────────────────────────────────────────────────────────────────────────── diff --git a/test/suite/batgrep.sh b/test/suite/batgrep.sh index 9827b42..e5c5932 100644 --- a/test/suite/batgrep.sh +++ b/test/suite/batgrep.sh @@ -92,3 +92,13 @@ test:option_context() { batgrep -C 0 '\$' file.txt } + +test:search_from_stdin() { + description "Should be able to search through stdin." + snapshot stdout + snapshot stderr + + require_rg + + cat file.txt | batgrep "^ca" +}