Skip to content

Commit

Permalink
Rework the basic test.
Browse files Browse the repository at this point in the history
  • Loading branch information
kosarev committed Jun 6, 2019
1 parent db2aae4 commit 4c76605
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 49 deletions.
26 changes: 5 additions & 21 deletions c/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
all: escapeless

test: \
test_all_bytes \
test_moby \
test_one_missed \
test_other_unused_takeout \
test_unused_takeout

LIB_HEADER = escapeless.h
LIB_SRC = escapeless.c

Expand All @@ -23,22 +16,13 @@ escapeless: $(CLI_SRC) $(LIB_SRC) $(LIB_HEADER)
tester: $(TESTER_SRC) $(LIB_SRC) $(LIB_HEADER)
cc $(CC_OPTS) -o tester $(TESTER_SRC) $(LIB_SRC)

test_moby: tester
./escapeless encode aef <$(TESTS)/moby.txt | diff - $(TESTS)/moby.txt.encoded
./escapeless decode aef <$(TESTS)/moby.txt.encoded | diff - $(TESTS)/moby.txt

test_all_bytes: tester
test: tester
./escapeless decode AB <$(TESTS)/one_missed.bin.encoded | diff - $(TESTS)/one_missed.bin
./escapeless encode AB <$(TESTS)/one_missed.bin | diff - $(TESTS)/one_missed.bin.encoded
./tester <$(TESTS)/all_bytes.test

test_unused_takeout: tester
./tester <$(TESTS)/unused_takeout.test

test_other_unused_takeout: tester
./tester <$(TESTS)/basic.test
./tester <$(TESTS)/other_unused_takeout.test

test_one_missed: tester
./escapeless encode AB <$(TESTS)/one_missed.bin | diff - $(TESTS)/one_missed.bin.encoded
./escapeless decode AB <$(TESTS)/one_missed.bin.encoded | diff - $(TESTS)/one_missed.bin
./tester <$(TESTS)/unused_takeout.test

clean:
-rm escapeless
11 changes: 11 additions & 0 deletions tests/basic.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# A common-looking block with multiple bytes repeated in it.

# Input block.
20..50 30..60 40..70 50..80 60..70

# Takeouts.
38 48 58

# Encoded block.
00 01 02 20..37 00 39..47 01 49..50 30..37 00 39..47 01 49..57 02 59..60 40..47 01 49..57 02 59..70 50..57 02 59..80 60..70
28 changes: 0 additions & 28 deletions tests/moby.txt

This file was deleted.

Binary file removed tests/moby.txt.encoded
Binary file not shown.

0 comments on commit 4c76605

Please sign in to comment.