update
This commit is contained in:
23
test/runtests.jl
Normal file
23
test/runtests.jl
Normal file
@@ -0,0 +1,23 @@
|
||||
using Test
|
||||
using GeneralUtils
|
||||
|
||||
@testset "detect_keyword tests" begin
|
||||
@test GeneralUtils.detect_keyword(["test"], "this is a test string") == Dict("test" => 1)
|
||||
@test GeneralUtils.detect_keyword(["hello", "world"], "hello world") == Dict("hello" => 1, "world" => 1)
|
||||
@test GeneralUtils.detect_keyword(["missing"], "no keyword here") == Dict("missing" => nothing)
|
||||
@test GeneralUtils.detect_keyword(["a", "b"], "a a b b b") == Dict("a" => 2, "b" => 3)
|
||||
@test GeneralUtils.detect_keyword(String[], "empty keywords") == Dict{String, Any}()
|
||||
@test GeneralUtils.detect_keyword(["keyword"], "") == Dict("keyword" => nothing)
|
||||
@test GeneralUtils.detect_keyword(["case"], "CASE case Case cAsE") == Dict("case" => 4)
|
||||
mixed_results = GeneralUtils.detect_keyword(["found", "notfound"], "found found found")
|
||||
@test mixed_results["found"] == 3
|
||||
@test mixed_results["notfound"] === nothing
|
||||
|
||||
special_chars = GeneralUtils.detect_keyword(["test!"], "test! test? test.")
|
||||
@test special_chars["test!"] == 1
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user