First commit
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
a test1
|
||||
a test2
|
||||
p
|
||||
s
|
||||
@@ -0,0 +1,2 @@
|
||||
test1
|
||||
test2
|
||||
@@ -0,0 +1,2 @@
|
||||
test1
|
||||
test2
|
||||
@@ -0,0 +1,5 @@
|
||||
a test1
|
||||
a test2
|
||||
d test1
|
||||
p
|
||||
s
|
||||
@@ -0,0 +1,3 @@
|
||||
d hello
|
||||
p
|
||||
s
|
||||
@@ -0,0 +1 @@
|
||||
test2
|
||||
@@ -0,0 +1 @@
|
||||
test2
|
||||
@@ -0,0 +1 @@
|
||||
s
|
||||
@@ -0,0 +1,5 @@
|
||||
a test1
|
||||
a test2
|
||||
f test1 test3
|
||||
p
|
||||
s
|
||||
@@ -0,0 +1,2 @@
|
||||
test3
|
||||
test2
|
||||
@@ -0,0 +1,2 @@
|
||||
test3
|
||||
test2
|
||||
@@ -0,0 +1,5 @@
|
||||
a hello
|
||||
a hi
|
||||
a hi
|
||||
p
|
||||
s
|
||||
@@ -0,0 +1,3 @@
|
||||
hello
|
||||
hi
|
||||
hi
|
||||
@@ -0,0 +1,3 @@
|
||||
hello
|
||||
hi
|
||||
hi
|
||||
@@ -0,0 +1,11 @@
|
||||
a hello
|
||||
a hi
|
||||
a hey
|
||||
p
|
||||
f hey yes
|
||||
p
|
||||
d hi
|
||||
p
|
||||
f hi maybe
|
||||
p
|
||||
s
|
||||
@@ -0,0 +1,10 @@
|
||||
hello
|
||||
hi
|
||||
hey
|
||||
hello
|
||||
hi
|
||||
yes
|
||||
hello
|
||||
yes
|
||||
hello
|
||||
yes
|
||||
@@ -0,0 +1,10 @@
|
||||
hello
|
||||
hi
|
||||
hey
|
||||
hello
|
||||
hi
|
||||
yes
|
||||
hello
|
||||
yes
|
||||
hello
|
||||
yes
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
function files() {
|
||||
if [ ! -f "$1.txt" ]; then
|
||||
echo "Creating $1.txt"
|
||||
touch "$1.txt"
|
||||
fi
|
||||
if [ ! -f "$1_Expected.txt" ]; then
|
||||
echo "Creating $1_Expected.txt"
|
||||
touch "$1_Expected.txt"
|
||||
fi
|
||||
if [ ! -f "$1_Result.txt" ]; then
|
||||
echo "Creating $1_Result.txt"
|
||||
touch "$1_Result.txt"
|
||||
fi
|
||||
}
|
||||
|
||||
function test() {
|
||||
# Check if the files exist and if not, create them
|
||||
files "$1"
|
||||
|
||||
../cmake-build-debug-wsl/Assignment1 < "$1.txt" > "$1_Result.txt"
|
||||
if diff -u "$1_Result.txt" "$1_Expected.txt";
|
||||
then
|
||||
echo "$1 test passed"
|
||||
else
|
||||
echo "$1 test failed"
|
||||
fi
|
||||
}
|
||||
test "findAndReplace"
|
||||
test "add"
|
||||
test "delete"
|
||||
test "pdf1"
|
||||
test "pdf2"
|
||||
test "exit"
|
||||
test "deleteEmpty"
|
||||
Reference in New Issue
Block a user