test: test-depunctuate test-sorter

depunctuate: depunctuate.c
	@echo "===== Building depunctuate ====="
	gcc -Wall -Werror -o $@ $<
	@echo

sorter: sorter.c
	@echo "===== Building sorter ====="
	gcc -Wall -Werror -o $@ $<
	@echo

test-depunctuate: depunctuate
	@echo "===== Testing depunctuate ====="
	./depunctuate depunctuate-input-1.txt depunctuate-output-1.txt
	@echo "[diff between your results and the expected results]"
	@diff depunctuate-output-1.txt depunctuate-expected-1.txt;\
        if [ $$? -eq 0 ]; then echo "TEST PASSED"; else echo "TEST FAILED"; fi
	@echo

test-sorter: sorter
	@echo "===== Testing sorter ====="
	./sorter sorter-input-1.txt > sorter-output-1.txt
	@echo "[diff between your results and the expected results]"
	@diff sorter-output-1.txt sorter-expected-1.txt;\
        if [ $$? -eq 0 ]; then echo "TEST PASSED"; else echo "TEST FAILED"; fi
	@echo

clean:
	rm -f sorter depunctuate
