@@ -39,32 +39,36 @@ mv ./packages/main/src/Main2.res ./packages/main/src/Main.res
39
39
# Rename a file with a dependent - this should trigger an error
40
40
mv ./packages/main/src/InternalDep.res ./packages/main/src/InternalDep2.res
41
41
rewatch build & > ../tests/snapshots/rename-file-internal-dep.txt
42
- # replace the absolute path so the snapshot is the same on all machines
43
- replace " s/ $( pwd | sed " s/\// \\\\ \//g " ) //g " ../tests/snapshots/rename-file-internal-dep.txt
42
+ # normalize paths so the snapshot is the same on all machines
43
+ normalize_paths ../tests/snapshots/rename-file-internal-dep.txt
44
44
mv ./packages/main/src/InternalDep2.res ./packages/main/src/InternalDep.res
45
45
46
46
# Rename a file with a dependent in a namespaced package - this should trigger an error (regression)
47
47
mv ./packages/new-namespace/src/Other_module.res ./packages/new-namespace/src/Other_module2.res
48
48
rewatch build & > ../tests/snapshots/rename-file-internal-dep-namespace.txt
49
- # replace the absolute path so the snapshot is the same on all machines
50
- replace " s/ $( pwd | sed " s/\// \\\\ \//g " ) //g " ../tests/snapshots/rename-file-internal-dep-namespace.txt
49
+ # normalize paths so the snapshot is the same on all machines
50
+ normalize_paths ../tests/snapshots/rename-file-internal-dep-namespace.txt
51
51
mv ./packages/new-namespace/src/Other_module2.res ./packages/new-namespace/src/Other_module.res
52
52
53
53
rewatch build & > /dev/null
54
54
mv ./packages/main/src/ModuleWithInterface.resi ./packages/main/src/ModuleWithInterface2.resi
55
55
rewatch build & > ../tests/snapshots/rename-interface-file.txt
56
+ # normalize paths so the snapshot is the same on all machines
57
+ normalize_paths ../tests/snapshots/rename-interface-file.txt
56
58
mv ./packages/main/src/ModuleWithInterface2.resi ./packages/main/src/ModuleWithInterface.resi
57
59
rewatch build & > /dev/null
58
60
mv ./packages/main/src/ModuleWithInterface.res ./packages/main/src/ModuleWithInterface2.res
59
61
rewatch build & > ../tests/snapshots/rename-file-with-interface.txt
62
+ # normalize paths so the snapshot is the same on all machines
63
+ normalize_paths ../tests/snapshots/rename-file-with-interface.txt
60
64
mv ./packages/main/src/ModuleWithInterface2.res ./packages/main/src/ModuleWithInterface.res
61
65
rewatch build & > /dev/null
62
66
63
67
# when deleting a file that other files depend on, the compile should fail
64
68
rm packages/dep02/src/Dep02.res
65
69
rewatch build & > ../tests/snapshots/remove-file.txt
66
- # replace the absolute path so the snapshot is the same on all machines
67
- replace " s/ $( pwd | sed " s/\// \\\\ \//g " ) //g " ../tests/snapshots/remove-file.txt
70
+ # normalize paths so the snapshot is the same on all machines
71
+ normalize_paths ../tests/snapshots/remove-file.txt
68
72
git checkout -- packages/dep02/src/Dep02.res
69
73
rewatch build & > /dev/null
70
74
0 commit comments