Files
OpenRA/t/8-file.lua
Paul Kulchenko 71667d2912 Fixed loading file with absolute name and line number (fixes #408).
This was broken by the change in 2ee9599 that was made to avoid delay when
relative filename with a line number looked like a network path (Windows).
2015-02-06 10:03:23 -08:00

11 lines
650 B
Lua

ok(not LoadFile(''), "Don't load file with an empty name.")
ok(not LoadFile("\r\n "), "Don't load file with name that only has whitespaces.")
ok(not LoadFile('t'), "Don't load file with directory as the name (1/2).")
ok(not LoadFile('./'), "Don't load file with directory as the name (2/2).")
local fullpath = MergeFullPath(wx.wxFileName.GetCwd(), 't/test.lua')
ok(ActivateFile('t/test.lua:10'), "Load file:line.")
ok(not ActivateFile('t/foo.bar:10'), "Doesn't load non-existent file:line.")
ok(ActivateFile(fullpath..':10'), "Load fullpath/file:line.")
ok(not ActivateFile(fullpath..'/foo.bar:10'), "Doesn't load non-existent fullpath/file:line.")