Skip to content

Commit

Permalink
Merge pull request #21 from julia-vscode/testsetup2
Browse files Browse the repository at this point in the history
Match final testsetup design
  • Loading branch information
davidanthoff authored Jul 7, 2024
2 parents 94245a3 + 9b7b590 commit 61eb6ba
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/TestItems.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
module TestItems

export @testitem, @testsetup
export @testitem, @testmodule, @testsnippet

macro testitem(ex...)
return nothing
end

macro testsetup(ex...)
macro testmodule(ex...)
return nothing
end

macro testsnippet(ex...)
return nothing
end

Expand Down
11 changes: 7 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ using Test
@testset "TestItems" begin

x = @testitem "Name of the test item" begin

println("Hello world")
end

@test x === nothing

x = @testsetup module TestSetup
y = @testmodule Foo begin
const x = 10
getfloat() = rand()
end
@test x === nothing
@test y === nothing

z = @testsnippet Bar begin
println("Hello world")
end
@test z ===nothing
end

0 comments on commit 61eb6ba

Please sign in to comment.