-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d2f3ed
commit 18d96c8
Showing
6 changed files
with
110 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using Luxor, Test | ||
|
||
f1 = "f1.svg" | ||
@svg begin | ||
text("hello") | ||
text("world") | ||
end 500 500 f1 | ||
|
||
f2 = "f2.svg" | ||
@svg begin | ||
text("hello") | ||
text("world") | ||
end 500 500 f2 | ||
|
||
tidysvg(f1, "f3.svg") | ||
tidysvg(f2, "f4.svg") | ||
|
||
lines_1 = open("f1.svg") do f | ||
readlines(f) | ||
end | ||
lines_2 = open("f2.svg") do f | ||
readlines(f) | ||
end | ||
lines_3 = open("f3.svg") do f | ||
readlines(f) | ||
end | ||
lines_4 = open("f4.svg") do f | ||
readlines(f) | ||
end | ||
|
||
# without running tidysvg(), symbols are the same | ||
for i in eachindex(lines_1) | ||
if occursin("<symbol", lines_1[i]) | ||
@test lines_1[i] == lines_2[i] | ||
end | ||
end | ||
|
||
# with after running tidysvg(), symbols should be different | ||
for i in eachindex(lines_3) | ||
if occursin("<symbol", lines_3[i]) | ||
@test lines_3[i] != lines_4[i] | ||
end | ||
end | ||
|
||
println("...finished tidysvg testing") |