Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Run tests
run: |
set -euo pipefail
carp -x test/strbuf.carp
carp -x --log-memory test/strbuf.carp

- name: Install angler
run: |
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ A growable string buffer for Carp.
## Installation

```clojure
(load "git@github.com:carpentry-org/strbuf@0.2.0")
(load "git@github.com:carpentry-org/strbuf@0.2.1")
```

## Usage
Expand Down Expand Up @@ -45,7 +45,7 @@ allocates a new string on every call.
## Testing

```
carp -x test/strbuf.carp
carp -x --log-memory test/strbuf.carp
```

<hr/>
Expand Down
2 changes: 1 addition & 1 deletion docs/StringBuf.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h1>
every call), <code>StringBuf</code> tracks capacity and grows geometrically, giving
amortized O(1) appends.</p>
<h2>Installation</h2>
<pre><code>(load &quot;git@github.com:carpentry-org/strbuf@0.2.0&quot;)
<pre><code>(load &quot;git@github.com:carpentry-org/strbuf@0.2.1&quot;)
</code></pre>
<h2>Usage</h2>
<pre><code>(let [sb (StringBuf.create)]
Expand Down
3 changes: 2 additions & 1 deletion strbuf.carp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ amortized O(1) appends.
## Installation

```
(load \"git@github.com:carpentry-org/strbuf@0.2.0\")
(load \"git@github.com:carpentry-org/strbuf@0.2.1\")
```

## Usage
Expand Down Expand Up @@ -77,6 +77,7 @@ modifying the buffer.")

(doc delete "frees the buffer.")
(register delete (Fn [StringBuf] ()))
(implements delete StringBuf.delete)

(register copy (Fn [&StringBuf] StringBuf))
(implements copy StringBuf.copy))
10 changes: 9 additions & 1 deletion test/strbuf.carp
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,12 @@
&(let-do [sb (StringBuf.with-capacity 0)]
(StringBuf.append-str &sb "hello")
(let-do [s (StringBuf.to-string &sb)] (StringBuf.delete sb) s))
"with-capacity 0 buffer grows and is usable"))
"with-capacity 0 buffer grows and is usable")

(assert-equal test
0l
(do
(Debug.reset-memory-balance!)
(let [sb (StringBuf.create)] ())
(Debug.memory-balance))
"owned buffers are deleted automatically at scope exit"))