Skip to content

Commit

Permalink
Fix relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrolich committed May 23, 2024
1 parent c43b6ed commit 5c64ccc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions tests/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ mv ./packages/main/src/Main2.res ./packages/main/src/Main.res
# Rename a file with a dependent - this should trigger an error
mv ./packages/main/src/InternalDep.res ./packages/main/src/InternalDep2.res
rewatch build --no-timing=true &> ../tests/snapshots/rename-file-internal-dep.txt
# replace the absolute path so the snapshot is the same on all machines
replace "s/$(pwd | sed "s/\//\\\\\//g")//g" ../tests/snapshots/rename-file-internal-dep.txt
mv ./packages/main/src/InternalDep2.res ./packages/main/src/InternalDep.res

# Rename a file with a dependent in a namespaced package - this should trigger an error (regression)
mv ./packages/new-namespace/src/Other_module.res ./packages/new-namespace/src/Other_module2.res
rewatch build --no-timing=true &> ../tests/snapshots/rename-file-internal-dep-namespace.txt
# replace the absolute path so the snapshot is the same on all machines
replace "s/$(pwd | sed "s/\//\\\\\//g")//g" ../tests/snapshots/rename-file-internal-dep-namespace.txt
mv ./packages/new-namespace/src/Other_module2.res ./packages/new-namespace/src/Other_module.res

rewatch build &> /dev/null
Expand Down
2 changes: 1 addition & 1 deletion tests/snapshots/rename-file-internal-dep-namespace.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[7/7] ️🛑 Compiled 3 modules in 0.00s

We've found a bug for you!
/Users/jfrolich/development/rewatch/testrepo/packages/new-namespace/src/NS_alias.res:2:1-16
/packages/new-namespace/src/NS_alias.res:2:1-16

1 │ let hello_world = () => "Hello world"
2 │ Other_module.bla()
Expand Down
2 changes: 1 addition & 1 deletion tests/snapshots/rename-file-internal-dep.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[7/7] ️🛑 Compiled 2 modules in 0.00s

We've found a bug for you!
/Users/jfrolich/development/rewatch/testrepo/packages/main/src/Main.res:4:8-24
/packages/main/src/Main.res:4:8-24

2 │ Dep01.log()
3 │
Expand Down

0 comments on commit 5c64ccc

Please sign in to comment.