luvit/luvit

Path test fails on Windows

SinisterRectus opened this issue · 4 comments

I don't know if this has always failed, but it appears that most of these tests fail on Windows. This code has not changed in 5 years. Tested with the current master branch on Windows 10 64-bit.

    -- resolving a drive-relative path will give an absolute path
    assert(path_base.nt:resolve('d:drive\\relative') == 'd:\\drive\\relative')
    assert(path_base.nt:resolve('d:..') == 'd:\\')
    assert(path_base.nt:resolve('d:.') == 'd:\\')
    assert(path_base.nt:resolve('d:.\\file') == 'd:\\file')
    assert(path_base.nt:resolve('c:\\blah\\blah', 'd:\\games', 'c:..\\a') == "c:\\blah\\a")
    assert(path_base.nt:resolve('d:\\foo', 'd:drive\\relative') == 'd:\\foo\\drive\\relative')
    assert(path_base.nt:resolve('C:\\foo', 'd:drive\\relative') == 'd:\\drive\\relative')
    assert(path_base.nt:resolve('d:foo', 'd:drive\\relative') == 'd:\\foo\\drive\\relative')
    assert(path_base.nt:resolve('c:foo', 'd:drive\\relative') == 'd:\\drive\\relative')
C:\Users\Sinister\Desktop\luvit>luvi . -- tests/test-path.lua
1..1

# Starting Test: path tests
  C:\Users\Sinister\Desktop\luvit\tests\test-path.lua:461: assertion failed!
C:\Users\Sinister\Desktop\luvit>luvi -v
luvi v2.11.0
libuv: 1.34.2
rex: 8.37 2015-04-28
winsvc: 1.0.0
ssl: OpenSSL 1.1.1d  10 Sep 2019, lua-openssl 0.7.7

Works on WSL

sinister@DESKTOP-SB6R31A:/mnt/c/Users/Sinister/Desktop/luvit$ ./luvi . -- tests/test-path.lua
1..1

# Starting Test: path tests
ok 1 path tests
# All tests passed

I re-ran this today and now it works. I have no idea what caused the original failure.

C:\Users\Sinister\Desktop\luvit>luvi . -- tests/test-path.lua
1..1

# Starting Test: path tests
ok 1 path tests
# All tests passed

Yeah, not sure what could have caused this. IIRC the path stuff is basically all pure Lua.

I'll close it. If it happens again, we can re-open. Very strange.