-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unit test and fixed bug #13
base: master
Are you sure you want to change the base?
Conversation
…Python repository[2] with exclusive tests for this library. Refs: [1] https://github.com/catchorg/Catch2 [2] https://github.com/seatgeek/fuzzywuzzy/blob/master/test_fuzzywuzzy.py
``` ReadmeExample (test_readme.cpp) FAILED: REQUIRE( 97 == fuzz::ratio("this is a test", "this is a test!") ); EXPANSION: 97 == 100 ``` The `full_process` is default on and will strip the tailing exclamation mark. It was fixed by altering the default value of `full_process` to false.
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON)
``` RaioTest testEmptyStringsScore100 FAILED: REQUIRE( 100 == fuzz::ratio("", "") ) EXPANSION: 100 == 0 ``` Fixed by checking empty string in `fuzz::ratio` and `fuzz:partial_ratio`.
``` RatioTest testPartialRatio FAILED: REQUIRE( 100 == fuzz::partial_ratio(s1, s1) ) EXPANSION: 100 == 0 ``` The `partial_ratio` of two identical strings should be 100 undoubtedly. The detailed description of this problem is written in the `fuzzywuzzy.cpp`.
1) How to build and run tests 2) Enable command `make test`
Thanks for taking the time to port unit tests over! I'll see about going over the commits the coming week. |
Just let me know if there is anything goes wrong or needs to be updated. ^_^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not partial to adding a ~17kloc library header. Could you source catch.hpp
from a submodule instead?
Okay, I think make it as an installed package or something likewise is more proper. Will be added in the next commit. |
1) Catch2 libray now need to be installed or placed in include path to build successfully 2) Add comments to describle the commented out testcases in `test_fuzzywuzzy.cpp`
I had updated the required change. Please review the code changes in this new commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pardon the extended delay. Commits look good to me. Please rebase out test/catch.hpp
from the commit history and I'll merge.
This pull request contains the following updates:
Unit Test
test
folder as before.CMakeLists.txt
andREADME.md
to provide instruction of building and running unit test.Fixed Bugs
full_process
is default on and will strip the tailing exclamation mark. It was fixed by altering the default value offull_process
tofalse
.ratio()
andpartial_ratio()
.partial_ratio()
of two identical string is 0% similarity which should be 100% undoubtedly. The detailed description is in thefuzzywuzzy.cpp
. This was fixed by a temporary solution to compare if two strings is identical or not.