hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit c811ca5051dd77f5f2148835f4f7cf08c4eafbda
parent 2a222f6ccad44fa1158a57b170b82193eb572d04
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sat,  8 Jan 2022 14:50:16 +0100

path::buffer: add additional test case

There are so many edge cases in this module. At least they're edge cases
we can implement and document and test instead of having every Hare
program which works with paths deal with it.

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Mpath/buffer.ha | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/path/buffer.ha b/path/buffer.ha @@ -167,6 +167,10 @@ fn doappend(buf: *buffer, elem: []u8) (void | errors::overflow) = { appendnorm(&buf, ".")!; appendnorm(&buf, "foo")!; assert(string(&buf) == "foo"); + appendnorm(&buf, "..")!; + assert(string(&buf) == "."); + appendnorm(&buf, "..")!; + assert(string(&buf) == ".."); reset(&buf); appendnorm(&buf, "..")!;