-
Notifications
You must be signed in to change notification settings - Fork 2
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
8a2e113
commit ac1bc03
Showing
2 changed files
with
103 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,69 @@ | ||
|
||
module TestCommands | ||
|
||
using Test: @test, @testset, @test_throws, @test_warn | ||
using Typstry | ||
|
||
const tc = typst`help` | ||
const tc_error = typst`` | ||
const tc_ignorestatus = ignorestatus(tc_error) | ||
|
||
@testset "`Typstry`" begin | ||
@testset "`TypstCommand`" begin end | ||
|
||
@testset "`TypstError`" begin end | ||
|
||
@testset "`@typst_cmd`" begin end | ||
|
||
@testset "`julia_mono`" begin | ||
# TODO: write more tests | ||
@test julia_mono isa String | ||
end | ||
|
||
@testset "`render`" begin end | ||
end | ||
|
||
@testset "`Base`" begin | ||
@testset "`==`" begin end | ||
|
||
@testset "`addenv`" begin end | ||
|
||
@testset "`detach`" begin end | ||
|
||
@testset "`eltype`" begin @test eltype(TypstCommand) == String end | ||
|
||
@testset "`firstindex`" begin @test firstindex(tc) == 1 end | ||
|
||
@testset "`getindex`" begin end | ||
|
||
@testset "`hash`" begin end | ||
|
||
@testset "`ignorestatus`" begin | ||
@test tc_ignorestatus == TypstCommand(tc_error; ignorestatus = true) | ||
@test_warn "error" run(tc_ignorestatus) | ||
end | ||
|
||
@testset "`iterate`" begin end | ||
|
||
@testset "`keys`" begin end | ||
|
||
@testset "`lastindex`" begin end | ||
|
||
@testset "`length`" begin end | ||
|
||
@testset "`run`" begin | ||
# TODO: write more tests | ||
@test_throws TypstError redirect_stderr(() -> run(tc_error), devnull) | ||
@test_warn "error" try run(tc_error) catch end | ||
end | ||
|
||
@testset "`setcpuaffinity`" begin end | ||
|
||
@testset "`setenv`" begin end | ||
|
||
@testset "`show`" begin end | ||
|
||
@testset "`showerror`" begin end | ||
end | ||
|
||
end # TestCommands |
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