First commit

This commit is contained in:
2023-09-15 23:55:52 -03:00
commit c997a29967
51 changed files with 595 additions and 0 deletions

View File

@ -0,0 +1,4 @@
a test1
a test2
p
s

View File

@ -0,0 +1,2 @@
test1
test2

View File

@ -0,0 +1,2 @@
test1
test2

View File

@ -0,0 +1,5 @@
a test1
a test2
d test1
p
s

View File

@ -0,0 +1,3 @@
d hello
p
s

View File

View File

@ -0,0 +1 @@
test2

View File

@ -0,0 +1 @@
test2

View File

@ -0,0 +1 @@
s

View File

View File

View File

@ -0,0 +1,5 @@
a test1
a test2
f test1 test3
p
s

View File

@ -0,0 +1,2 @@
test3
test2

View File

@ -0,0 +1,2 @@
test3
test2

View File

@ -0,0 +1,5 @@
a hello
a hi
a hi
p
s

View File

@ -0,0 +1,3 @@
hello
hi
hi

View File

@ -0,0 +1,3 @@
hello
hi
hi

View File

@ -0,0 +1,11 @@
a hello
a hi
a hey
p
f hey yes
p
d hi
p
f hi maybe
p
s

View File

@ -0,0 +1,10 @@
hello
hi
hey
hello
hi
yes
hello
yes
hello
yes

View File

@ -0,0 +1,10 @@
hello
hi
hey
hello
hi
yes
hello
yes
hello
yes

36
Assignment1/tests/test.sh Normal file
View File

@ -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"