[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Writing tests for the REPL: tab-completion, etc
From: |
Jose E. Marchesi |
Subject: |
Re: Writing tests for the REPL: tab-completion, etc |
Date: |
Sun, 12 Apr 2020 09:58:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Adding a new test to poke.repl involves editing poke.repl/repl.exp and
adding a new set of poke_test_cmd invocations, like this:
poke_start
set test "slashes are preserved"
poke_test_cmd {4 / 2} {2}
set test "tab-completion-1"
poke_test_cmd {.set obase 2} {}
poke_test_cmd ".se\t obase 16" {}
poke_test_cmd {.set obase} {16}
poke_exit
On a second though, I think it is better to keep each test as
self-contained as possible. This involves starting and exitting poke in
each test, unless a test depends on another one.
This means, for the two tests above:
set test "slashes are preserved"
poke_start
poke_test_cmd {4 / 2} {2}
poke_exit
set test "tab-completion-1"
poke_start
poke_test_cmd {.set obase 2} {}
poke_test_cmd ".se\t obase 16" {}
poke_test_cmd {.set obase} {16}
poke_exit
I updated the testsuite and HACKING accordingly.
Salud!