Skip to content

Commit

Permalink
Merge pull request #50 from Evizero/jc/new_ref
Browse files Browse the repository at this point in the history
save converted actual result as reference
  • Loading branch information
johnnychen94 authored Jan 12, 2020
2 parents 9a5ae50 + a347c6e commit b8dae6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/test_reference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ function test_reference(
rendermode = default_rendermode(F, raw_actual)
end

actual = _convert(F, raw_actual; kw...)
# preprocessing when reference file doesn't exists
if !isfile(path)
println("Reference file for \"$filename\" does not exist.")
# TODO: move encoding out from render
render(rendermode, raw_actual)

if !isinteractive()
Expand All @@ -120,15 +122,14 @@ function test_reference(
@test false
else
mkpath(dir)
savefile(file, raw_actual)
savefile(file, actual)
@info("Please run the tests again for any changes to take effect")
end

return nothing # skip current test case
end

# file exists
actual = _convert(F, raw_actual; kw...)
reference = loadfile(T, file)

if equiv === nothing
Expand Down

2 comments on commit b8dae6a

@johnnychen94
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/7809

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.4 -m "<description of version>" b8dae6a42d84ed685b25a4a13c232daa08d1fd5d
git push origin v0.8.4

Please sign in to comment.