test failed in msys2 on win10
Error info:
[0/1] Run test.OS: windows 10.0.18363
Arch: x86_64
Compiler: GCC 14.1.0
CRT: libstdc++ 20240507
DEBUG: false
..............................................................................................F.....
......
Failed tests:
-------------
1) filewatch.test_2
create_directories: "I:/msys64/tmp/test_bee/temp/dir": (generic:13)Permission denied
stack traceback:
bee.lua/test/test_filewatch.lua:39: in local 'f'
bee.lua/test/test_filewatch.lua:28: in upvalue 'test'
bee.lua/test/test_filewatch.lua:38: in upvalue 'filewatch.test_2'
Ran 106 tests in 1.826 seconds, 105 successes, 1 failures
FAILED: build/mingw/obj/test.stamp
build/mingw/bin/bootstrap.exe bee.lua/test/test.lua --touch build/mingw/obj/test.stamp
ninja: build stopped: subcommand failed.
I check the dir, 'temp' in not found.
Change code at test_filewatch.lua:18
local root = fs.absolute("./temp/"):lexically_normal()
to
local root = fs.absolute("./"):lexically_normal()
then test all pass.
fs.create_directories means recursively create directories. This test code should not fail, if it fails, it means there is a bug in gcc or mingw.
Remove test:test_1 function, the test_2 will pass. I guess gulrak/filesystem library is not synchronous.
才发现是中国的。 测试的时候在test里加了个打印create_directories的返回值,一个true一个false。 应该是test2刚开始的时候temp还没删掉,等运行到28行的时候已经被删掉了,导致错误。 不过这种错误在不同环境中可能出现在不同的地方。