Skip to content
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

Issue 46: Topic matching bugfix and unit tests #47

Merged
merged 1 commit into from Jan 29, 2023

Conversation

plundeen
Copy link

Updates the FastMQTT.match() algorithm to be compliant with the specification.

Also added unit tests, but I haven't created github actions to automate running the tests.

@plundeen
Copy link
Author

tests/test_topic_match.py::TestTopicMatching::test_matching[sport/tennis/player1-sport/tennis/player1-True] PASSED                                                       [  6%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[sport/tennis/#-sport/tennis/player1-True] PASSED                                                             [ 12%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[sport/tennis/#-sport/tennis-True] PASSED                                                                     [ 18%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[#-sport/tennis/player1-True] PASSED                                                                          [ 31%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[sport/+/player1-sport/tennis/player1-True] PASSED                                                            [ 37%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[+/tennis/player1-sport/tennis/player1-True] PASSED                                                           [ 43%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[sport/tennis/+-sport/tennis/player1-True] PASSED                                                             [ 50%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[sport/+/#-sport/tennis/player1-True] PASSED                                                                  [ 56%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[$SYS/state-$SYS/state-True] PASSED                                                                           [ 62%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[$SYS/#-$SYS/state-True] PASSED                                                                               [ 68%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[/foo/bar-/foo/bar-True] PASSED                                                                               [ 75%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[/#-/foo/bar-True] PASSED                                                                                     [ 81%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[sport/tennis/player1-sport/tennis/player1/ranking-False] PASSED                                              [ 87%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[sport/tennis/player1-sport/tennis/player2-False] PASSED                                                      [ 93%] 
tests/test_topic_match.py::TestTopicMatching::test_matching[sport/+/player1-sport/tennis/player2-False] PASSED                                                           [100%] 

============================================================================= 16 passed in 0.65s ==============================================================================

@sabuhish
Copy link
Owner

Thanks a lot for your PR, it is great to see this change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants