Annotate

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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10897
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
1 local rb = require "util.ringbuffer";
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
2 describe("util.ringbuffer", function ()
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
3 describe("#new", function ()
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
4 it("has a constructor", function ()
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
5 assert.Function(rb.new);
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
6 end);
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
7 it("can be created", function ()
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
8 assert.truthy(rb.new());
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
9 end);
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
10 end);
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
11 describe(":write", function ()
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
12 local b = rb.new();
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
13 it("works", function ()
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
14 assert.truthy(b:write("hi"));
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
15 end);
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
16 end);
37df1e757f02 util.ringbuffer: Add some initial tests
Kim Alvefur <zash@zash.se>
parents:
diff changeset
17 end);