File: multimap_spec.lua

package info (click to toggle)
lua-penlight 1.15.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,724 kB
  • sloc: makefile: 4
file content (14 lines) | stat: -rw-r--r-- 327 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
local MultiMap = require("pl.MultiMap")

describe("pl.MultiMap", function ()

  it("should hold multiple values per key", function ()
    local map = MultiMap()
    map:set('foo', 1)
    map:set('bar', 3)
    map:set('foo', 2)
    local expected = { foo = { 1, 2 }, bar = { 3 } }
    assert.is.same(expected, map)
  end)

end)