hare

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

commit eed09f5e277b79b3a024714e2f6f6146405f18a0
parent 6486722b49c3924585c5f86b16489b75c2b595c5
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sat,  8 Jan 2022 14:38:49 +0100

path: @test: don't be quite so rough on the stack

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

Diffstat:
Mpath/buffer.ha | 11+++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/path/buffer.ha b/path/buffer.ha @@ -141,7 +141,7 @@ fn doappend(buf: *buffer, elem: []u8) (void | errors::overflow) = { appendnorm(&buf, ".")!; assert(string(&buf) == "foo/bar/baz/bad"); - let buf = init(); + reset(&buf); appendnorm(&buf, "/")!; appendnorm(&buf, "foo")!; appendnorm(&buf, "bar")!; @@ -151,18 +151,18 @@ fn doappend(buf: *buffer, elem: []u8) (void | errors::overflow) = { appendnorm(&buf, "/")!; assert(string(&buf) == "/foo/bar/baz"); - let buf = init(); + reset(&buf); appendnorm(&buf, "/")!; appendnorm(&buf, "/")!; appendnorm(&buf, "/")!; assert(string(&buf) == "/"); - let buf = init(); + reset(&buf); appendnorm(&buf, ".")!; appendnorm(&buf, "foo")!; assert(string(&buf) == "foo"); - let buf = init(); + reset(&buf); appendnorm(&buf, "..")!; assert(string(&buf) == ".."); appendnorm(&buf, "..")!; @@ -170,7 +170,7 @@ fn doappend(buf: *buffer, elem: []u8) (void | errors::overflow) = { appendnorm(&buf, "..")!; assert(string(&buf) == "../../.."); - let buf = init(); + reset(&buf); appendnorm(&buf, "foo")!; appendnorm(&buf, "bar")!; assert(string(&buf) == "foo/bar"); @@ -183,7 +183,6 @@ fn doappend(buf: *buffer, elem: []u8) (void | errors::overflow) = { appendnorm(&buf, "..")!; assert(string(&buf) == "../.."); - let buf = init(); set(&buf, "foo", "bar")!; assert(string(&buf) == "foo/bar"); set(&buf, "foo", "bar/")!;