foreseen

A text-based gemini browser with prefetching
git clone git://git.laack.co/foreseen.git
Log | Files | Refs | README | LICENSE

commit a7c4ac0dbf541e50ebbed373256af8aa41dee75f
parent 6254ff6de2feeee86d3b83d87d121694e6fddb4d
Author: Andrew Laack <andrew@laack.co>
Date:   Tue, 29 Sep 2026 21:22:35 -0500

Cover 'n' branch

Diffstat:
Mtests/puppet-test.cpp | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/tests/puppet-test.cpp b/tests/puppet-test.cpp @@ -125,6 +125,30 @@ TEST_CASE("Handle redirects") { REQUIRE(b.getCurrentLink()->getLinkDestination().to_string() == "gemini://gemini.conman.org/"); } +TEST_CASE("Handle redirect rejection") { + Browser b {}; + DrawState ds {}; + REQUIRE(mainLoop(ds, b, 'o')); + REQUIRE(mainLoop(ds, b, 'c')); + REQUIRE(mainLoop(ds, b, 'o')); + REQUIRE(mainLoop(ds, b, 'n')); + REQUIRE(mainLoop(ds, b, 'm')); + REQUIRE(mainLoop(ds, b, 'a')); + REQUIRE(mainLoop(ds, b, 'n')); + REQUIRE(mainLoop(ds, b, '.')); + REQUIRE(mainLoop(ds, b, 'o')); + REQUIRE(mainLoop(ds, b, 'r')); + REQUIRE(mainLoop(ds, b, 'g')); + REQUIRE(mainLoop(ds, b, '\n')); + + REQUIRE(b.getCurrentLink()->getLinkDestination().to_string() == "gemini://conman.org"); + + REQUIRE(mainLoop(ds, b, 'n')); // follow redirect + REQUIRE(b.getCurrentLink()->getLinkDestination().to_string() == "about://newtab"); +} + + + //TEST_CASE("Enter an input") { // Browser b {};