Keys must be Comparable (defines the <=> method).
I had to update the test to not try to use a Symbol as a key because it cannot be compared.
Do not force keys to be strings
Thank you! Pushed 1.1.1 now. Yes, the test is also derived from RadixTree which should be removed.
By the way, you seem to using Float as a key. Float#<=> in Ruby compares [double == double] in C so it's hardly reliable as a key, no?
It should work as far as the key does not collide. Is this OK? > map[2.0/2] = 1; map[1.0] = 2; map.keys #=> 1
And I realized it introduced weird behavior: map = RedBlackTree.new; map[1.0] = 1; map = 1; p map.size #=> 1
It's logical from 'key must be Comparable' specification but I'm not sure it's acceptable as a Hash...
That is interesting.
In my case I think that's just fine, but it's possible that it would make sense to do some sort of key class check...