Skip to content

Commit

Permalink
Test that GemVersion is hashable
Browse files Browse the repository at this point in the history
Reference: aboutcode-org/vulnerablecode#926
Reference: aboutcode-org/vulnerablecode#608
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
  • Loading branch information
pombredanne authored Feb 10, 2023
1 parent 0e4dfee commit 1794018
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_rubygems_gem_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ def test_canonical_segments():
assert GemVersion("1.0.0.a.1.0").canonical_segments == (1, "a", 1)
assert GemVersion("1.2.3-1").canonical_segments == (1, 2, 3, "pre", 1)

def test_GemVersion_is_hashable():
hash(GemVersion("1.0.0"))


def test_frozen_version():
ver = GemVersion("1.test")
Expand Down

0 comments on commit 1794018

Please sign in to comment.