/vendor/gems/facets-2.4.5/test/core/string/test_natcmp.rb
Ruby | 17 lines | 11 code | 5 blank | 1 comment | 0 complexity | 244a6076cb93d3a8fe4af4a248ffc374 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
- # Test for facets/string/natcmp
- require 'facets/string/natcmp.rb'
- require 'test/unit'
- class TestStringCompare < Test::Unit::TestCase
- def test_natcmp
- assert( -1, "my_prog_v1.1.0".natcmp("my_prog_v1.2.0") )
- assert( -1, "my_prog_v1.2.0".natcmp("my_prog_v1.10.0") )
- assert( 1, "my_prog_v1.2.0".natcmp("my_prog_v1.1.0") )
- assert( 1, "my_prog_v1.10.0".natcmp("my_prog_v1.2.0") )
- assert( 0, "my_prog_v1.0.0".natcmp("my_prog_v1.0.0") )
- end
- end