summaryrefslogtreecommitdiff
path: root/Data/Libraries/Penlight/spec/multimap_spec.lua
blob: a83d1500d0aaf6115c216b24c5cc3570d8703898 (plain)
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)