Skip to content

Commit

Permalink
Remove redundant tests
Browse files Browse the repository at this point in the history
Given pretty much all of the VSCode specific code was removed from TypedSyntax, it seems unnecessary to rerun all the tests.
  • Loading branch information
Zentrik committed Sep 3, 2023
1 parent a017a4d commit ce3c869
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 676 deletions.
40 changes: 32 additions & 8 deletions TypedSyntax/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -667,12 +667,36 @@ module VSCodeServer
return nothing
end
end
module TestVSCodeExt # stops modules defined in test files from overwriting stuff from previous test
using Test, ..VSCodeServer

@testset "VSCode TypedSyntax.jl" begin
@testset "test_vscode.jl" begin
include("test_vscode.jl")
end
end
using TypedSyntax: InlayHint, Diagnostic, InlayHintKinds

@testset "test_vscode.jl" begin
# VSCode
tsn = TypedSyntaxNode(TSN.fVSCode, (Int64,))

io = IOContext(devnull, :inlay_hints=>Dict{String, Vector{InlayHint}}(), :diagnostics=>Diagnostic[])
printstyled(io, tsn)
@test getproperty.(first(values(io[:inlay_hints])), :kind) == [InlayHintKinds.Nothing, InlayHintKinds.Type, InlayHintKinds.Nothing] && getproperty.(first(values(io[:inlay_hints])), :label) == ["::Union{Float64, Int64}", "(", ")::Union{Float64, Int64}"]
@test length(io[:diagnostics]) == 2

io = IOContext(devnull, :inlay_hints=>Dict{String, Vector{InlayHint}}(), :diagnostics=>Diagnostic[])
printstyled(io, tsn; hide_type_stable=false)
@test getproperty.(first(values(io[:inlay_hints])), :kind) == vcat(InlayHintKinds.Type, InlayHintKinds.Nothing, repeat([InlayHintKinds.Type], 15), InlayHintKinds.Nothing) && getproperty.(first(values(io[:inlay_hints])), :label) == ["::Int64"
"::Union{Float64, Int64}"
"::Int64"
"("
"::Int64"
")::Int64"
"::Int64"
"("
"::Int64"
")::Int64"
"("
"::Int64"
"("
"::Int64"
")::Bool"
"::Int64"
"::Float64"
")::Union{Float64, Int64}"]
@test length(io[:diagnostics]) == 2
end
Loading

0 comments on commit ce3c869

Please sign in to comment.