Software / code / prosody
Comparison
spec/util_ringbuffer_spec.lua @ 10897:37df1e757f02
util.ringbuffer: Add some initial tests
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 29 May 2020 17:53:00 +0200 |
| child | 10898:c6465fb3c839 |
comparison
equal
deleted
inserted
replaced
| 10896:c7a0eab27165 | 10897:37df1e757f02 |
|---|---|
| 1 local rb = require "util.ringbuffer"; | |
| 2 describe("util.ringbuffer", function () | |
| 3 describe("#new", function () | |
| 4 it("has a constructor", function () | |
| 5 assert.Function(rb.new); | |
| 6 end); | |
| 7 it("can be created", function () | |
| 8 assert.truthy(rb.new()); | |
| 9 end); | |
| 10 end); | |
| 11 describe(":write", function () | |
| 12 local b = rb.new(); | |
| 13 it("works", function () | |
| 14 assert.truthy(b:write("hi")); | |
| 15 end); | |
| 16 end); | |
| 17 end); |