Skip to content

Commit

Permalink
Add some basic tests for wrap-paragraph command
Browse files Browse the repository at this point in the history
  • Loading branch information
craigbarnes committed Dec 27, 2024
1 parent 1b216c0 commit 2f1d21c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mk/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ BUILTIN_CONFIGS = $(addprefix config/, \

TEST_CONFIGS := $(addprefix test/data/, $(addsuffix .dterc, \
env thai crlf insert join change pipe redo replace shift repeat \
fuzz1 fuzz2 ))
fuzz1 fuzz2 wrap ))

CC_VERSION = $(or \
$(shell $(CC) --version 2>/dev/null | head -n1), \
Expand Down
1 change: 1 addition & 0 deletions test/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ static void test_exec_config(TestContext *ctx)
"replace.txt",
"shift.txt",
"repeat.txt",
"wrap.txt",
};

// Delete output files left over from previous runs
Expand Down
11 changes: 11 additions & 0 deletions test/data/wrap.dterc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
open

repeat 30 insert "xyz "
wrap-paragraph
repeat 2 new-line

repeat 30 insert "xyz "
wrap-paragraph 20

save -f build/test/wrap.txt
close
9 changes: 9 additions & 0 deletions test/data/wrap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz
xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz xyz

xyz xyz xyz xyz xyz
xyz xyz xyz xyz xyz
xyz xyz xyz xyz xyz
xyz xyz xyz xyz xyz
xyz xyz xyz xyz xyz
xyz xyz xyz xyz xyz

0 comments on commit 2f1d21c

Please sign in to comment.