From c2c8d02a1bb48b0f81683ffc4949fea9f40ae66a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Vin=C3=ADcius=20Garcia?= <vingarcia00@gmail.com>
Date: Sun, 27 Mar 2022 10:16:47 -0300
Subject: [PATCH] Fix test coverage issue

---
 scripts/run-with-replace.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/scripts/run-with-replace.sh b/scripts/run-with-replace.sh
index 5d8bdae..19db1b3 100755
--- a/scripts/run-with-replace.sh
+++ b/scripts/run-with-replace.sh
@@ -1,16 +1,20 @@
 #!/usr/bin/env bash
 
+cmd=$@
+
 # Update go.mod with replace so testing will
 # run against the local version of ksql:
 echo "replace github.com/vingarcia/ksql => ../../" >> go.mod
 go mod tidy
-go test
+
+# Run the input command:
+eval $cmd
 
 # Save whether the tests succeeded or not:
 tests_succedeed=$?
 
 # Undo the changes:
-git checkout go.mod go.sum > /dev/null
+git checkout go.mod go.sum > /dev/null 2>&1
 
 # Return error if the tests failed:
 test $tests_succedeed -eq 0