Skip to content

Commit

Permalink
Print root-package relative path of the file where a failure happens (#…
Browse files Browse the repository at this point in the history
…22)

Issue #20 is about printing the absolute path and not the
package-relative path as this commit implements. We decided to use the
root-package relative path as the absolute path exposes details about
where you store your files and also makes the spec for `Spec` itself
difficult.

The root-package is the one where you are running `savi build` or `savi
run` from.

This requires savi v0.20220921.1 or later.

Related issues: #20
  • Loading branch information
mneumann authored Sep 22, 2022
1 parent 4e3b4a1 commit f54fbed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/Spec.Process.Spec.savi
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
""
" Expected to be True"
""
" # Spec.Process.Spec.savi: 45"
" # spec/Spec.Process.Spec.savi: 45"
""
""
], "\n")
Expand Down
2 changes: 1 addition & 1 deletion src/Spec.Assert.savi
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

:fun file_and_line String
line = @pos.row + 1
"# \(@pos.filename): \(line.format.decimal)"
"# \(@pos.filepath_rootpkgrel): \(line.format.decimal)"

:fun indent(times USize, msg String) String
String.join([" " * times, msg])
Expand Down

0 comments on commit f54fbed

Please sign in to comment.