Sha256: 44266d3c901c5ec48f782677f4fee5837d0e6bb67c2e6a9aaae0df47bd5d819d

Contents?: true

Size: 781 Bytes

Versions: 10

Compression:

Stored size: 781 Bytes

Contents

#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../lib/puppettest'

require 'puppet'
require 'puppet/util/package'
require 'puppettest'

class TestPuppetUtilPackage < Test::Unit::TestCase
    include PuppetTest
    include Puppet::Util::Package

    def test_versioncmp
        ary = %w{ 1.1.6 2.3 1.1a 3.0 1.5 1 2.4 1.1-4 
            2.3.1 1.2 2.3.0 1.1-3 2.4b 2.4 2.40.2 2.3a.1 3.1 0002 1.1-5 1.1.a 1.06}

        newary = nil
        assert_nothing_raised do
            newary = ary.sort { |a, b|
                versioncmp(a,b)
            }
        end
        assert_equal(["0002", "1", "1.06", "1.1-3", "1.1-4", "1.1-5", "1.1.6", "1.1.a", "1.1a", "1.2", "1.5", "2.3", "2.3.0", "2.3.1", "2.3a.1", "2.4", "2.4", "2.4b", "2.40.2", "3.0", "3.1"], newary)
    end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
puppet-0.24.9 test/util/package.rb
puppet-0.24.0 test/util/package.rb
puppet-0.24.2 test/util/package.rb
puppet-0.24.1 test/util/package.rb
puppet-0.24.3 test/util/package.rb
puppet-0.24.4 test/util/package.rb
puppet-0.24.6 test/util/package.rb
puppet-0.24.7 test/util/package.rb
puppet-0.24.5 test/util/package.rb
puppet-0.24.8 test/util/package.rb