Moved UUID collision warning to stderr to improve visibility

This commit is contained in:
Jason Perkins 2013-01-17 14:37:49 -05:00
parent e0f0537aa2
commit 8e7da0f3be
2 changed files with 2 additions and 14 deletions

View File

@ -274,7 +274,7 @@
local id = builtin_uuid(name)
if name then
if os._uuids[id] and os._uuids[id] ~= name then
print(string.format("** Warning: UUID clash between %s and %s", os._uuids[id], name))
io.stderr:write(string.format("** Warning: UUID clash between %s and %s\n", os._uuids[id], name))
end
os._uuids[id] = name
end

View File

@ -12,7 +12,7 @@
--
local builtin_print, result
function suite.setup()
builtin_print = print
print = function(value)
@ -50,15 +50,3 @@
function suite.isDeterministic_onName()
test.isequal("885E8F4B-F43D-0EE7-FD55-99BD69B47448", os.uuid("MyValue"))
end
--
-- A warning should be shown is an ID clash is ever discovered.
--
function suite.showsWarning_onCollision()
-- use a bit of secret knowledge to make the test possible
os._uuids["885E8F4B-F43D-0EE7-FD55-99BD69B47448"] = "Some other value"
os.uuid("MyValue")
test.istrue(result:startswith("** Warning:"))
end