2014-05-30 01:26:32 +00:00
|
|
|
local env = environment()
|
|
|
|
env, n1 = add_private_name(env, "foo")
|
|
|
|
print(n1)
|
|
|
|
env, n2 = add_private_name(env, "foo")
|
|
|
|
print(n2)
|
|
|
|
env, n3 = add_private_name(env, {"foo", "bla"})
|
|
|
|
print(n3)
|
|
|
|
assert(n1 ~= n2)
|
|
|
|
assert(n1 ~= n3)
|
|
|
|
assert(n2 ~= n3)
|
2014-05-31 00:51:22 +00:00
|
|
|
assert(hidden_to_user_name(env, n1))
|
|
|
|
assert(hidden_to_user_name(env, n1) == name("foo"))
|
|
|
|
assert(hidden_to_user_name(env, n2) == name("foo"))
|
|
|
|
assert(hidden_to_user_name(env, n3) == name("foo", "bla"))
|
|
|
|
|
2014-05-30 01:26:32 +00:00
|
|
|
|
|
|
|
env:export("prv_mod.olean")
|
|
|
|
local env2 = import_modules("prv_mod")
|
2014-05-31 00:51:22 +00:00
|
|
|
assert(hidden_to_user_name(env2, n1) == name("foo"))
|
|
|
|
assert(hidden_to_user_name(env2, n2) == name("foo"))
|
|
|
|
assert(hidden_to_user_name(env2, n3) == name("foo", "bla"))
|
2014-05-30 01:26:32 +00:00
|
|
|
env2, n4 = add_private_name(env2, "foo")
|
|
|
|
print(n4)
|
|
|
|
assert(n1 ~= n4)
|
2014-05-31 00:51:22 +00:00
|
|
|
assert(not hidden_to_user_name(env, n4))
|