pantheios-ruby 0.9.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.unshift File.join(File.dirname(__FILE__), '../../..', 'lib')
4
+
5
+ require 'pantheios/util/version_util'
6
+
7
+ require 'xqsr3/extensions/test/unit'
8
+
9
+ require 'test/unit'
10
+
11
+ class Test_VersionUtil_version_compare < Test::Unit::TestCase
12
+
13
+ VU = ::Pantheios::Util::VersionUtil
14
+
15
+ def test_equal_strings
16
+
17
+ assert_equal 0, VU.version_compare('1.0.0', '1.0.0')
18
+ assert_equal 0, VU.version_compare('1.2.3', '1.2.3')
19
+ assert_equal 0, VU.version_compare('1.2', '1.2')
20
+ assert_equal 0, VU.version_compare('1', '1')
21
+ end
22
+
23
+ def test_unequal_strings
24
+
25
+ assert_not_equal 0, VU.version_compare('1.0.0', '1.0.1')
26
+ assert_not_equal 0, VU.version_compare('1.2.3', '1.3.3')
27
+ assert_not_equal 0, VU.version_compare('1.2.3', '1.3')
28
+ assert_not_equal 0, VU.version_compare('1.2', '2.2')
29
+ assert_not_equal 0, VU.version_compare('1', '2')
30
+ assert_not_equal 0, VU.version_compare('1.2.3.4.5.6.7.8.9', '2')
31
+
32
+ assert VU.version_compare('1.0.0', '1.0.1') < 0
33
+ assert VU.version_compare('0.0.9', '1.0.0') < 0
34
+
35
+ assert VU.version_compare('1.0.1', '1.0.0') > 0
36
+ assert VU.version_compare('1.0.0', '0.0.9') > 0
37
+ end
38
+
39
+ def test_equal_arrays
40
+
41
+ assert_equal 0, VU.version_compare([ 1, 0, 0 ], [ 1, 0, 0 ])
42
+ assert_equal 0, VU.version_compare([ 1, 2, 3 ], [ 1, 2, 3 ])
43
+ assert_equal 0, VU.version_compare([ 1, 2 ], [ 1, 2 ])
44
+ assert_equal 0, VU.version_compare([ 1 ], [ 1 ])
45
+ end
46
+
47
+ def test_unequal_arrays
48
+
49
+ assert_not_equal 0, VU.version_compare([ 1, 0, 0 ], [ 1, 0, 1 ])
50
+ assert_not_equal 0, VU.version_compare([ 1, 2, 3 ], [ 1, 3, 3 ])
51
+ assert_not_equal 0, VU.version_compare([ 1, 2, 3 ], [ 1, 3 ])
52
+ assert_not_equal 0, VU.version_compare([ 1, 2 ], [ 2, 2 ])
53
+ assert_not_equal 0, VU.version_compare([ 1 ], [ 2 ])
54
+ assert_not_equal 0, VU.version_compare([ 1, 2, 3, 4, 5, 6, 7, 8, 9 ], [ 2 ])
55
+
56
+ assert VU.version_compare([ 1, 0, 0 ], [ 1, 0, 1 ]) < 0
57
+ assert VU.version_compare([ 0, 0, 9 ], [ 1, 0, 0 ]) < 0
58
+
59
+ assert VU.version_compare([ 1, 0, 1 ], [ 1, 0, 0 ]) > 0
60
+ assert VU.version_compare([ 1, 0, 0 ], [ 0, 0, 9 ]) > 0
61
+ end
62
+
63
+
64
+ def test_equal_heterogenous_types
65
+
66
+ assert_equal 0, VU.version_compare('1.0.0', [ 1, 0, 0 ])
67
+ assert_equal 0, VU.version_compare([ 1, 0, 0 ], '1.0.0')
68
+
69
+ assert_equal 0, VU.version_compare('1.2.3', [ 1, 2, 3 ])
70
+ assert_equal 0, VU.version_compare([ 1, 2, 3 ], '1.2.3')
71
+
72
+ assert_equal 0, VU.version_compare('1.2', [ 1, 2 ])
73
+ assert_equal 0, VU.version_compare([ 1, 2 ], '1.2')
74
+
75
+ assert_equal 0, VU.version_compare('1', [ 1 ])
76
+ assert_equal 0, VU.version_compare([ 1 ], '1')
77
+ end
78
+
79
+ end
80
+
@@ -0,0 +1,12 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # executes all other tests
4
+
5
+ this_dir = File.expand_path(File.dirname(__FILE__))
6
+
7
+ # all tc_*rb in current directory
8
+ Dir[File.join(this_dir, 'tc_*rb')].each { |file| require file }
9
+
10
+ # all ts_*rb in immediate sub-directories
11
+ Dir[File.join(this_dir, '*', 'ts_*rb')].each { |file| require file }
12
+
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pantheios-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.6
5
+ platform: ruby
6
+ authors:
7
+ - Matt Wilson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-01-06 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: xqsr3
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.17.1
20
+ - - <
21
+ - !ruby/object:Gem::Version
22
+ version: '1.0'
23
+ type: :development
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.17.1
30
+ - - <
31
+ - !ruby/object:Gem::Version
32
+ version: '1.0'
33
+ description: |
34
+ A Ruby version of the popular C++ (and .NET) logging API library
35
+ email: matthew@synesis.com.au
36
+ executables: []
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - lib/pantheios.rb
41
+ - lib/pantheios/api.rb
42
+ - lib/pantheios/application_layer.rb
43
+ - lib/pantheios/application_layer/param_name_list.rb
44
+ - lib/pantheios/application_layer/stock_severity_levels.rb
45
+ - lib/pantheios/core.rb
46
+ - lib/pantheios/globals.rb
47
+ - lib/pantheios/services/simple_console_service.rb
48
+ - lib/pantheios/util.rb
49
+ - lib/pantheios/util/process_util.rb
50
+ - lib/pantheios/util/thread_util.rb
51
+ - lib/pantheios/util/version_util.rb
52
+ - lib/pantheios/version.rb
53
+ - test/unit/application_layer/tc_param_name_list.rb
54
+ - test/unit/application_layer/tc_stock_severity_levels.rb
55
+ - test/unit/application_layer/ts_all.rb
56
+ - test/unit/ts_all.rb
57
+ - test/unit/util/tc_thread_util.rb
58
+ - test/unit/util/tc_version_util.rb
59
+ - test/unit/util/ts_all.rb
60
+ homepage: http://www.pantheios.org/
61
+ licenses:
62
+ - Modified BSD
63
+ metadata: {}
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 2.4.2
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: Pantheios.Ruby
84
+ test_files: []
85
+ has_rdoc: