lean2/tests/lua/name_gen1.lua

12 lines
379 B
Lua
Raw Normal View History

local g = name_generator("tst")
assert(g:next() == name("tst", 0))
assert(g:next() == name("tst", 1))
assert(g:prefix() == name("tst"))
local cg = g:mk_child()
assert(cg:prefix() == name("tst", 2))
assert(cg:next() == name("tst", 2, 0))
assert(cg:next() == name("tst", 2, 1))
assert(cg:next() == name("tst", 2, 2))
assert(g:next() == name("tst", 3))
assert(is_name_generator(g))