Skip to content

[os.windows] vlib\os\os_test.c.v test fail #24356

Description

@kbkpbot

Describe the bug

run v test on vlib\os\os_test.c.v will fail under windows

Reproduction Steps

v vlib\os\os_test.c.v

Expected Behavior

pass the test

Current Behavior

D:\v\v\v>"D:\v\v\v\v.exe"   -b c "D:\v\v\v\vlib\os\os_test.c.v"
testsuite_begin, tfolder = C:\Users\DDT\AppData\Local\Temp\v_0\os_tests
C:\Users\DDT\AppData\Local\Temp\v_0\os_tests\tolink_file.txt
D:\\v\\v\\v\\vlib\\os\\os_test.c.v:638: fn test_rmdir_not_exist
   > assert err.code() == 0x00000002
     Left value (len: 1): `0`
    Right value (len: 1): `2`

>>> os.Command is not implemented fully on Windows yet
skipping test_mv_by_cp, because bindfs was not present
skipping test_mv_by_cp, because bindfs was not present

Possible Solution

wrong use of C.GetLastError()

Additional Information/Context

No response

V version

V 0.4.10 af947f1.af947f1

Environment details (OS name and version, etc.)

V full version V 0.4.10 af947f1.af947f1
OS windows, Microsoft Windows 10 企业版 LTSC 19044 64 位
Processor 16 cpus, 64bit, little endian, AMD Ryzen 7 7840H with Radeon 780M Graphics
Memory 2.03GB/27.69GB
V executable D:\v\v\v\v.exe
V last modified time 2025-04-29 11:51:58
V home dir OK, value: D:\v\v\v
VMODULES OK, value: C:\Users\DDT.vmodules
VTMP OK, value: C:\Users\DDT\AppData\Local\Temp\v_0
Current working dir OK, value: D:\v\v\v
Git version git version 2.43.0.windows.1
V git status weekly.2025.17-16-gaf947f1a-dirty
.git/config present true
cc version N/A
gcc version N/A
clang version N/A
msvc version 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.39.33523 版
tcc version tcc version 0.9.28rc 2025-04-19_mob@36ff4f52* (x86_64 Windows)
tcc git status N/A
emcc version N/A
glibc version N/A

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Metadata

Metadata

Assignees

Labels

BugThis tag is applied to issues which reports bugs.OS: WindowsBugs/feature requests, that are specific to Windows OS.

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions