| ... | ... | @@ -896,25 +896,23 @@ test "header parse mode" { |
| 896 | 896 | } |
| 897 | 897 | |
| 898 | 898 | test "create file and symlink" { |
| 899 | | // With test enabled this is hanging under windows: |
| 900 | | // zig build test docs --zig-lib-dir .\lib\ -Dstatic-llvm -Dskip-non-native -Denable-symlinks-windows |
| 901 | | const builtin = @import("builtin"); |
| 902 | | if (builtin.os.tag == .windows) return error.SkipZigTest; |
| 903 | | |
| 904 | 899 | var root = std.testing.tmpDir(.{}); |
| 905 | 900 | defer root.cleanup(); |
| 906 | 901 | |
| 907 | | _ = try createDirAndFile(root.dir, "file1"); |
| 908 | | _ = try createDirAndFile(root.dir, "a/b/c/file2"); |
| 902 | var file = try createDirAndFile(root.dir, "file1"); |
| 903 | file.close(); |
| 904 | file = try createDirAndFile(root.dir, "a/b/c/file2"); |
| 905 | file.close(); |
| 909 | 906 | |
| 910 | | _ = createDirAndSymlink(root.dir, "a/b/c/file2", "symlink1") catch |err| { |
| 907 | createDirAndSymlink(root.dir, "a/b/c/file2", "symlink1") catch |err| { |
| 911 | 908 | // On Windows when developer mode is not enabled |
| 912 | 909 | if (err == error.AccessDenied) return error.SkipZigTest; |
| 913 | 910 | return err; |
| 914 | 911 | }; |
| 915 | | _ = try createDirAndSymlink(root.dir, "../../../file1", "d/e/f/symlink2"); |
| 912 | try createDirAndSymlink(root.dir, "../../../file1", "d/e/f/symlink2"); |
| 916 | 913 | |
| 917 | 914 | // Danglink symlnik, file created later |
| 918 | | _ = try createDirAndSymlink(root.dir, "../../../g/h/i/file4", "j/k/l/symlink3"); |
| 919 | | _ = try createDirAndFile(root.dir, "g/h/i/file4"); |
| 915 | try createDirAndSymlink(root.dir, "../../../g/h/i/file4", "j/k/l/symlink3"); |
| 916 | file = try createDirAndFile(root.dir, "g/h/i/file4"); |
| 917 | file.close(); |
| 920 | 918 | } |