Skip to content

Commit

Permalink
add tests and tag new version
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieugomez committed Apr 7, 2024
1 parent b7dd39f commit d47e43a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "StringDistances"
uuid = "88034a9c-02f8-509d-84a9-84ec65e18404"
version = "0.11.2"
version = "0.11.3"

[deps]
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
Expand Down
16 changes: 15 additions & 1 deletion test/modifiers.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

using StringDistances, Unicode, Test
using StringDistances, Unicode, Random, Test

@testset "Modifiers" begin
# Partial
Expand Down Expand Up @@ -150,4 +150,18 @@ end
@test findall("New York", skipmissing(["NewYork", "Newark", missing]), Levenshtein()) == [1]
@test findall("New York", skipmissing(Union{AbstractString, Missing}[missing, missing]), Levenshtein()) == []
end


Random.seed!(2)
y = map(Random.randstring, rand(5:25,1_000))
x = Random.randstring(10)
for dist in (Levenshtein(), OptimalStringAlignment(), QGram(2), Partial(OptimalStringAlignment()), TokenMax(OptimalStringAlignment()))
result = [compare(x, y, dist) for y in y]
@test findnearest(x, y, dist)[2] == findmax(result)[2]
@test findall(x, y, dist; min_score = 0.4) == findall(result .>= 0.4)
end




end

2 comments on commit d47e43a

@matthieugomez
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/104433

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.11.3 -m "<description of version>" d47e43a757a0e7902a35b6d3a044a55f6c803921
git push origin v0.11.3

Please sign in to comment.