kyanite 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gemtest +0 -0
- data/0_rake_test.bat +2 -1
- data/1_rake_install_gem.bat +1 -1
- data/4_ruby_script_console.bat +2 -1
- data/Div +0 -0
- data/History.txt +2 -0
- data/License.txt +0 -0
- data/Manifest.txt +2 -14
- data/README.txt +4 -0
- data/Rakefile.rb +32 -30
- data/init.rb +0 -0
- data/lib/kyanite.rb +3 -3
- data/lib/kyanite/array.rb +0 -0
- data/lib/kyanite/array/array.rb +5 -31
- data/lib/kyanite/array/array2.rb +0 -0
- data/lib/kyanite/array/matrix2.rb +0 -0
- data/lib/kyanite/array_of_enumerables.rb +0 -0
- data/lib/kyanite/array_of_numerics.rb +0 -0
- data/lib/kyanite/array_of_strings.rb +0 -0
- data/lib/kyanite/basics.rb +0 -0
- data/lib/kyanite/dictionary.rb +2 -3
- data/lib/kyanite/enumerable.rb +0 -0
- data/lib/kyanite/enumerable/enumerable_enumerables.rb +1 -0
- data/lib/kyanite/enumerable/enumerable_numerics.rb +1 -1
- data/lib/kyanite/enumerable/enumerable_strings.rb +1 -0
- data/lib/kyanite/enumerable/structure.rb +5 -1
- data/lib/kyanite/general.rb +0 -0
- data/lib/kyanite/general/callerutils.rb +0 -0
- data/lib/kyanite/general/classutils.rb +4 -4
- data/lib/kyanite/general/kernel.rb +9 -12
- data/lib/kyanite/general/nil.rb +3 -1
- data/lib/kyanite/general/object.rb +2 -5
- data/lib/kyanite/general/true_false.rb +0 -0
- data/lib/kyanite/general/undoable.rb +0 -0
- data/lib/kyanite/hash.rb +8 -13
- data/lib/kyanite/matrix2.rb +0 -0
- data/lib/kyanite/nil.rb +0 -0
- data/lib/kyanite/numeric.rb +0 -0
- data/lib/kyanite/numeric/float.rb +0 -0
- data/lib/kyanite/numeric/integer.rb +0 -0
- data/lib/kyanite/numeric/numeric.rb +0 -0
- data/lib/kyanite/operation.rb +0 -0
- data/lib/kyanite/operation/call_tracker.rb +0 -0
- data/lib/kyanite/operation/rake.rb +0 -0
- data/lib/kyanite/operation/regexp.rb +0 -0
- data/lib/kyanite/operation/unit_test.rb +2 -5
- data/lib/kyanite/optimizer.rb +0 -1
- data/lib/kyanite/rake.rb +0 -0
- data/lib/kyanite/range.rb +0 -0
- data/lib/kyanite/set.rb +0 -1
- data/lib/kyanite/string.rb +1 -1
- data/lib/kyanite/string/cast.rb +0 -0
- data/lib/kyanite/string/chars.rb +24 -28
- data/lib/kyanite/string/chars_const.rb +12 -12
- data/lib/kyanite/string/diff.rb +0 -0
- data/lib/kyanite/string/div.rb +0 -0
- data/lib/kyanite/string/include.rb +0 -0
- data/lib/kyanite/string/list.rb +0 -0
- data/lib/kyanite/string/nested.rb +0 -0
- data/lib/kyanite/string/random.rb +1 -0
- data/lib/kyanite/string/split.rb +0 -0
- data/lib/kyanite/symbol.rb +0 -0
- data/lib/kyanite/tree.rb +51 -16
- data/lib/kyanite/undoable.rb +0 -0
- data/lib/kyanite/unit_test.rb +0 -0
- data/script/{console → console.rb} +0 -0
- data/smart_load_path.rb +6 -0
- data/test/_start_all.rb +3 -0
- data/test/array/test_array.rb +2 -9
- data/test/array/test_matrix2.rb +1 -5
- data/test/enumerable/test_enumerable_enumerables.rb +1 -4
- data/test/enumerable/test_enumerable_numerics.rb +35 -38
- data/test/enumerable/test_enumerable_strings.rb +1 -4
- data/test/enumerable/test_structure.rb +1 -4
- data/test/general/test_classutils.rb +1 -4
- data/test/general/test_nil.rb +1 -4
- data/test/general/test_object.rb +1 -3
- data/test/general/test_true_false.rb +1 -4
- data/test/numeric/test_numeric_integer.rb +1 -3
- data/test/string/test_cast.rb +2 -4
- data/test/string/test_chars.rb +19 -20
- data/test/string/test_diff.rb +2 -4
- data/test/string/test_list.rb +3 -4
- data/test/string/test_nested.rb +2 -4
- data/test/string/test_split.rb +2 -4
- data/test/test_dictionary.rb +2 -3
- data/test/test_hash.rb +2 -3
- data/test/test_optimizer.rb +2 -3
- data/test/test_range.rb +2 -3
- data/test/test_set.rb +17 -16
- data/test/test_tree.rb +9 -7
- metadata +105 -89
- data/config/website.yml +0 -2
- data/lib/kyanite/smart_load_path.rb +0 -2
- data/lib/kyanite/string/mgsub.rb +0 -39
- data/script/console.cmd +0 -1
- data/script/destroy +0 -14
- data/script/destroy.cmd +0 -1
- data/script/generate +0 -14
- data/script/generate.cmd +0 -1
- data/script/txt2html +0 -82
- data/script/txt2html.cmd +0 -1
- data/tasks/deployment.rake +0 -92
- data/tasks/documentation.rake +0 -28
- data/tasks/environment.rake +0 -7
data/test/_start_all.rb
CHANGED
data/test/array/test_array.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
|
-
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
2
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
3
|
require 'kyanite/array/array'
|
7
4
|
require 'kyanite/numeric/numeric'
|
8
5
|
require 'kyanite/set'
|
@@ -86,11 +83,7 @@ class TestKyaniteArray < UnitTest
|
|
86
83
|
|
87
84
|
|
88
85
|
|
89
|
-
|
90
|
-
numbers = [1, 3, 4, 6, 9, 10, 11]
|
91
|
-
result = numbers.divide { |i,j| (i - j).abs == 1 }
|
92
|
-
assert_equal [[11, 10, 9], [6], [1], [3, 4]], result
|
93
|
-
end
|
86
|
+
|
94
87
|
|
95
88
|
|
96
89
|
|
data/test/array/test_matrix2.rb
CHANGED
@@ -1,9 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
3
2
|
require 'kyanite/unit_test'
|
4
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
5
|
-
require 'perception' if $0 == __FILE__
|
6
|
-
|
7
3
|
require 'kyanite/matrix2'
|
8
4
|
require 'kyanite/general/nil'
|
9
5
|
|
@@ -1,8 +1,5 @@
|
|
1
|
-
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
2
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
3
|
require 'kyanite/enumerable/enumerable_enumerables'
|
7
4
|
|
8
5
|
class Array
|
@@ -1,8 +1,5 @@
|
|
1
|
-
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
2
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
3
|
require 'kyanite/enumerable/enumerable_numerics'
|
7
4
|
|
8
5
|
class Array
|
@@ -38,51 +35,51 @@ class TestKyaniteEnumerableNumerics < UnitTest
|
|
38
35
|
a = [1,2,3,4,5,6,7,8,9]
|
39
36
|
assert_equal 5.0, a.average
|
40
37
|
|
41
|
-
assert_equal 2, [2].avg
|
42
|
-
assert_equal 2.5, [2,3].avg
|
43
|
-
assert_equal 2.5, [3,2].avg
|
44
|
-
assert_equal 0.
|
45
|
-
assert_equal 1.25, [0.5,0.5,2,2].avg
|
38
|
+
assert_equal 2, ([2].avg * 100000000).round / 100000000.0
|
39
|
+
assert_equal 2.5, ([2,3].avg * 100000000).round / 100000000.0
|
40
|
+
assert_equal 2.5, ([3,2].avg * 100000000).round / 100000000.0
|
41
|
+
assert_equal 0.33333333, ([2,2,-3].avg * 100000000).round / 100000000.0
|
42
|
+
assert_equal 1.25, ([0.5,0.5,2,2].avg * 100000000).round / 100000000.0
|
46
43
|
|
47
|
-
assert_equal 75, [ 50, 100 ].mean_arithmetric
|
48
|
-
assert_equal 66.
|
49
|
-
assert_equal 70.
|
44
|
+
assert_equal 75, ([ 50, 100 ].mean_arithmetric * 100000000).round / 100000000.0
|
45
|
+
assert_equal 66.66666667, ([ 50, 100 ].mean_harmonic * 100000000).round / 100000000.0
|
46
|
+
assert_equal 70.71067812, ([ 50, 100 ].mean_geometric * 100000000).round / 100000000.0
|
50
47
|
|
51
|
-
assert_equal 66.
|
52
|
-
assert_equal 66.6666667, [ 100, 0.0000001, 100 ].mean_arithmetric
|
53
|
-
assert_equal 0.0, [ 100, 0, 100 ].mean_harmonic
|
54
|
-
assert_equal
|
55
|
-
assert_equal 0, [ 100, 0, 100 ].mean_geometric
|
56
|
-
assert_equal 0.1, [ 100, 0.0000001, 100 ].mean_geometric
|
48
|
+
assert_equal 66.66666667, ([ 100, 0, 100 ].mean_arithmetric * 100000000).round / 100000000.0
|
49
|
+
assert_equal 66.6666667, ([ 100, 0.0000001, 100 ].mean_arithmetric * 100000000).round / 100000000.0
|
50
|
+
assert_equal 0.0, ([ 100, 0, 100 ].mean_harmonic * 100000000).round / 100000000.0
|
51
|
+
assert_equal 3.0e-007, ([ 100, 0.0000001, 100 ].mean_harmonic * 100000000).round / 100000000.0
|
52
|
+
assert_equal 0, ([ 100, 0, 100 ].mean_geometric * 100000000).round / 100000000.0
|
53
|
+
assert_equal 0.1, ([ 100, 0.0000001, 100 ].mean_geometric * 100000000).round / 100000000.0
|
57
54
|
end
|
58
55
|
|
59
56
|
|
60
57
|
def test_mean_harmonic
|
61
|
-
assert_equal 66.
|
62
|
-
assert_equal 0.0, [ 100, 0, 100 ].mean_harmonic
|
63
|
-
assert_equal
|
64
|
-
assert_equal 4, [ 1, -2 ].mean_harmonic # formal richtig, aber sinnlos
|
65
|
-
assert_equal -0.5, [ 1, -2 ].mean_harmonic(:allow_negative => true)
|
66
|
-
assert_equal -0.5, [ 1, 1, -2, -2 ].mean_harmonic(:allow_negative => true)
|
67
|
-
assert_equal -2, [ -2, -2 ].mean_harmonic(:allow_negative => true)
|
68
|
-
assert_equal 2, [ 2, 2 ].mean_harmonic(:allow_negative => true)
|
69
|
-
assert_equal 0, [ -2, 2 ].mean_harmonic(:allow_negative => true)
|
70
|
-
assert_equal 0, [ 2, -2 ].mean_harmonic(:allow_negative => true)
|
71
|
-
assert_equal 0.
|
58
|
+
assert_equal 66.66666667, ([ 50, 100 ].mean_harmonic * 100000000).round / 100000000.0
|
59
|
+
assert_equal 0.0, ([ 100, 0, 100 ].mean_harmonic * 100000000).round / 100000000.0
|
60
|
+
assert_equal 3.0e-007, ([ 100, 0.0000001, 100 ].mean_harmonic * 100000000).round / 100000000.0
|
61
|
+
assert_equal 4, ([ 1, -2 ].mean_harmonic * 100000000).round / 100000000.0 # formal richtig, aber sinnlos
|
62
|
+
assert_equal -0.5, ([ 1, -2 ].mean_harmonic(:allow_negative => true) * 100000000).round / 100000000.0
|
63
|
+
assert_equal -0.5, ([ 1, 1, -2, -2 ].mean_harmonic(:allow_negative => true) * 100000000).round / 100000000.0
|
64
|
+
assert_equal -2, ([ -2, -2 ].mean_harmonic(:allow_negative => true) * 100000000).round / 100000000.0
|
65
|
+
assert_equal 2, ([ 2, 2 ].mean_harmonic(:allow_negative => true) * 100000000).round / 100000000.0
|
66
|
+
assert_equal 0, ([ -2, 2 ].mean_harmonic(:allow_negative => true) * 100000000).round / 100000000.0
|
67
|
+
assert_equal 0, ([ 2, -2 ].mean_harmonic(:allow_negative => true) * 100000000).round / 100000000.0
|
68
|
+
assert_equal 0.66666667, ([ 2, 2, -2 ].mean_harmonic(:allow_negative => true) * 100000000).round / 100000000.0
|
72
69
|
end
|
73
70
|
|
74
71
|
|
75
72
|
def test_parallel
|
76
|
-
assert_equal 1, [1].parallel
|
77
|
-
assert_equal 0.5, [1,1].parallel
|
78
|
-
assert_equal 0.
|
79
|
-
assert_equal 0.25, [1,1,1,1].parallel
|
73
|
+
assert_equal 1, ([1].parallel * 100000000).round / 100000000.0
|
74
|
+
assert_equal 0.5, ([1,1].parallel * 100000000).round / 100000000.0
|
75
|
+
assert_equal 0.33333333, ([1,1,1].parallel * 100000000).round / 100000000.0
|
76
|
+
assert_equal 0.25, ([1,1,1,1].parallel * 100000000).round / 100000000.0
|
80
77
|
|
81
|
-
assert_equal 2, [2].parallel
|
82
|
-
assert_equal 1, [2,2].parallel
|
83
|
-
assert_equal 0.
|
84
|
-
assert_equal 0.5, [2,2,2,2].parallel
|
85
|
-
assert_equal 0.5, [2,2,1].parallel
|
78
|
+
assert_equal 2, ([2].parallel * 100000000).round / 100000000.0
|
79
|
+
assert_equal 1, ([2,2].parallel * 100000000).round / 100000000.0
|
80
|
+
assert_equal 0.66666667, ([2,2,2].parallel * 100000000).round / 100000000.0
|
81
|
+
assert_equal 0.5, ([2,2,2,2].parallel * 100000000).round / 100000000.0
|
82
|
+
assert_equal 0.5, ([2,2,1].parallel * 100000000).round / 100000000.0
|
86
83
|
end
|
87
84
|
|
88
85
|
|
@@ -1,8 +1,5 @@
|
|
1
|
-
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
2
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
3
|
require 'kyanite/enumerable/enumerable_strings'
|
7
4
|
|
8
5
|
class Array
|
@@ -1,8 +1,5 @@
|
|
1
|
-
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
2
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
3
|
require 'kyanite/enumerable/structure'
|
7
4
|
require 'kyanite/dictionary'
|
8
5
|
require 'kyanite/set'
|
@@ -1,8 +1,5 @@
|
|
1
|
-
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
2
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
3
|
require 'kyanite/general/classutils'
|
7
4
|
|
8
5
|
class DummyClass1 # :nodoc:
|
data/test/general/test_nil.rb
CHANGED
@@ -1,8 +1,5 @@
|
|
1
|
-
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
2
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
3
|
require 'kyanite/general/nil'
|
7
4
|
|
8
5
|
# Tests for NilClass
|
data/test/general/test_object.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
|
2
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
3
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
4
|
require 'kyanite/general/object'
|
7
5
|
require 'kyanite/general/true_false'
|
8
6
|
|
@@ -1,8 +1,5 @@
|
|
1
|
-
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
2
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
3
|
require 'kyanite/general/true_false'
|
7
4
|
require 'kyanite/general/nil'
|
8
5
|
|
@@ -1,8 +1,6 @@
|
|
1
1
|
|
2
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
3
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
4
|
require 'kyanite/numeric'
|
7
5
|
|
8
6
|
# Tests for Numeric
|
data/test/string/test_cast.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
|
1
|
+
# ruby encoding: utf-8
|
2
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
3
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
4
|
require 'kyanite/string/cast'
|
7
5
|
|
8
6
|
|
data/test/string/test_chars.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
|
1
|
+
# ruby encoding: utf-8
|
2
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
3
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
4
|
require 'kyanite/string/chars'
|
5
|
+
|
7
6
|
|
8
7
|
|
9
8
|
|
@@ -133,17 +132,17 @@ ENDOFSTRING
|
|
133
132
|
|
134
133
|
|
135
134
|
|
136
|
-
def test_mysqlize
|
137
|
-
test0 = 'aaoouuß'
|
138
|
-
test1 = 'aäoöuüss'
|
139
|
-
test2 = 'AÄOÖUÜSS'
|
140
|
-
test3 = 'AAOOUUß'
|
135
|
+
# def test_mysqlize
|
136
|
+
# test0 = 'aaoouuß'
|
137
|
+
# test1 = 'aäoöuüss'
|
138
|
+
# test2 = 'AÄOÖUÜSS'
|
139
|
+
# test3 = 'AAOOUUß'
|
141
140
|
|
142
|
-
assert_equal test0, test0.mysqlize
|
143
|
-
assert_equal test0, test1.mysqlize
|
144
|
-
assert_equal test0, test2.mysqlize
|
145
|
-
assert_equal test0, test3.mysqlize
|
146
|
-
end
|
141
|
+
# assert_equal test0, test0.mysqlize
|
142
|
+
# assert_equal test0, test1.mysqlize
|
143
|
+
# assert_equal test0, test2.mysqlize
|
144
|
+
# assert_equal test0, test3.mysqlize
|
145
|
+
# end
|
147
146
|
|
148
147
|
|
149
148
|
|
@@ -160,7 +159,7 @@ ENDOFSTRING
|
|
160
159
|
|
161
160
|
# Bescheid sagen, sobald Ruby oder ActiveSupport von sich aus funktionieren
|
162
161
|
assert_not_equal test_down, test_up.downcase
|
163
|
-
assert_not_equal test_down, test_up.
|
162
|
+
assert_not_equal test_down, test_up.downcase
|
164
163
|
|
165
164
|
assert_equal test_down, test_up.downcase2
|
166
165
|
assert_equal test_down, test_up.upcase2.downcase2
|
@@ -204,15 +203,15 @@ ENDOFSTRING
|
|
204
203
|
test_down = 'äaoöuü'
|
205
204
|
test_up = 'ÄAOÖUÜ'
|
206
205
|
|
207
|
-
assert_equal 'Äaoöuü', 'äaoöuü'.
|
208
|
-
assert_equal 'Àaoöuü', 'àaoöuü'.
|
209
|
-
assert_equal 'Ăăaoöuü', 'ăăaoöuü'.
|
210
|
-
assert_equal 'Öaoöuü', 'Öaoöuü'.
|
206
|
+
assert_equal 'Äaoöuü', 'äaoöuü'.capitalize
|
207
|
+
assert_equal 'Àaoöuü', 'àaoöuü'.capitalize
|
208
|
+
assert_equal 'Ăăaoöuü', 'ăăaoöuü'.capitalize
|
209
|
+
assert_equal 'Öaoöuü', 'Öaoöuü'.capitalize
|
211
210
|
end
|
212
211
|
|
213
212
|
|
214
213
|
def test_utf8_size
|
215
|
-
assert_equal 3, 'Özi'.
|
214
|
+
assert_equal 3, 'Özi'.size
|
216
215
|
end
|
217
216
|
|
218
217
|
|
data/test/string/test_diff.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
|
1
|
+
# ruby encoding: utf-8
|
2
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
3
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
4
|
require 'kyanite/string/diff'
|
7
5
|
|
8
6
|
|
data/test/string/test_list.rb
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
|
1
|
+
# ruby encoding: utf-8
|
2
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
3
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
4
|
+
require 'kyanite/dictionary'
|
6
5
|
require 'kyanite/string/list'
|
7
6
|
require 'kyanite/string/chars'
|
8
7
|
WA_ABBREV = :abbrev unless defined?(WA_ABBREV)
|
data/test/string/test_nested.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
|
1
|
+
# ruby encoding: utf-8
|
2
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
3
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
4
|
require 'kyanite/string/nested'
|
7
5
|
|
8
6
|
|
data/test/string/test_split.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
|
1
|
+
# ruby encoding: utf-8
|
2
|
+
require File.join(File.dirname(__FILE__), '..', '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
2
3
|
require 'kyanite/unit_test'
|
3
|
-
require 'kyanite/smart_load_path'; smart_load_path
|
4
|
-
require 'perception' if $0 == __FILE__
|
5
|
-
|
6
4
|
require 'kyanite/string/split'
|
7
5
|
|
8
6
|
|
data/test/test_dictionary.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
|
2
|
-
require '
|
3
|
-
require 'kyanite/
|
4
|
-
require 'perception' if $0 == __FILE__
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
3
|
+
require 'kyanite/unit_test'
|
5
4
|
|
6
5
|
require 'kyanite/dictionary'
|
7
6
|
|
data/test/test_hash.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
|
2
|
-
require '
|
3
|
-
require 'kyanite/
|
4
|
-
require 'perception' if $0 == __FILE__
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
3
|
+
require 'kyanite/unit_test'
|
5
4
|
|
6
5
|
require 'kyanite/hash'
|
7
6
|
|
data/test/test_optimizer.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
|
2
|
-
require '
|
3
|
-
require 'kyanite/
|
4
|
-
require 'perception' if $0 == __FILE__
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
3
|
+
require 'kyanite/unit_test'
|
5
4
|
|
6
5
|
require 'kyanite/optimizer'
|
7
6
|
|
data/test/test_range.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
|
2
|
-
require '
|
3
|
-
require 'kyanite/
|
4
|
-
require 'perception' if $0 == __FILE__
|
2
|
+
require File.join(File.dirname(__FILE__), '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
3
|
+
require 'kyanite/unit_test'
|
5
4
|
|
6
5
|
require 'kyanite/range'
|
7
6
|
|
data/test/test_set.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
+
# ruby encoding: utf-8
|
1
2
|
|
2
|
-
require '
|
3
|
-
require 'kyanite/
|
4
|
-
require 'perception' if $0 == __FILE__
|
3
|
+
require File.join(File.dirname(__FILE__), '..', 'smart_load_path.rb' ); smart_load_path if $0 == __FILE__
|
4
|
+
require 'kyanite/unit_test'
|
5
5
|
|
6
6
|
require 'kyanite/set'
|
7
7
|
|
@@ -131,29 +131,29 @@ class TestKyaniteSet < UnitTest
|
|
131
131
|
#return
|
132
132
|
|
133
133
|
a = [ 'Liam', 'Lolomai', 'Ljubow', 'Luise', 'Livian', 'Levin', 'Lian', 'Leana', 'Lorita', 'Lady', 'Leslie', 'Lena', 'Lensi', 'Livio', 'Lorraine',
|
134
|
-
'Liana', 'Linus', 'Lennet', 'Lorna', 'Levi', 'Leonie', 'Linna', 'Lucill', 'Luk', '
|
135
|
-
'
|
134
|
+
'Liana', 'Linus', 'Lennet', 'Lorna', 'Levi', 'Leonie', 'Linna', 'Lucill', 'Luk', 'Léan', 'Laurence', 'Laurin', 'Lucia', 'Lúthien',
|
135
|
+
'László', 'Leonharda', 'Liane', 'Lene', 'Lambert', 'Lukas', 'Lothar', 'Lykka', 'Lissy', 'Lilian', 'Lina', 'Liv', 'Laura', 'Levent',
|
136
136
|
'Lotta', 'Lysander', 'Lientje', 'Lynn', 'Lea', 'Lucie', 'Laurens', 'Lance', 'Lionel', 'Leonore', 'Leni', 'Larry', 'Lale', 'Laurent',
|
137
137
|
'Leontine', 'Lara', 'Larissa', 'Lamprecht', 'Leandro', 'Leyla', 'Ljilja', 'Line', 'Liz', 'Lloyd', 'Lotte', 'Ludwig', 'Lodewijk', 'Leonhard',
|
138
138
|
'Laurentius', 'Lenn', 'Leticia', 'Lioba', 'Leif', 'Louis', 'Lieselotte', 'Lenelies', 'Lennart', 'Levke', 'Lizzy', 'Luis', 'Lorenz', 'Lei',
|
139
139
|
'Laurenz', 'Levente', 'Lucius', 'Louisa', 'Lorcan', 'Lucy', 'Lutz', 'Liria', 'Ludmilla', 'Lilli', 'Lewin', 'Luciano', 'Linn', 'Laetitia',
|
140
140
|
'Liselotte', 'Lasse', 'Louise', 'Laje', 'Len', 'Linda', 'Lieven', 'Luitgard', 'Lais', 'Lisanne', 'Lunis', 'Leo', 'Laijana', 'Lyn', 'Leolas',
|
141
141
|
'Leona', 'Laatvik', 'Latif', 'Luka', 'Lutricia', 'Lia', 'Leonard', 'Larina', 'Livia', 'Leiderat', 'Lukaja', 'Ljudmila', 'Leila', 'Lienhard',
|
142
|
-
'Lenja', '
|
142
|
+
'Lenja', 'Ljubiša', 'Lilith', 'Lennox', 'Luna', 'Lenio', 'Leah', 'Lydia', 'Ljiljana', 'Lili', 'Lauritz', 'Liska', 'Lola', 'Lenny', 'Lenore',
|
143
143
|
'Lorena', 'Leilani', 'Leon', 'Lacey', 'Luke', 'Lars', 'Lev', 'Ludger', 'Laila', 'Loris', 'Lakambini', 'Lidwina', 'Laurentia', 'Larees',
|
144
144
|
'Luana', 'Leoni', 'Loreley', 'Lucas', 'Luca', 'Langer', 'Liah', 'Leander', 'Letizia', 'Luc', 'Lana', 'Laurie', 'Linnea', 'Lajos',
|
145
145
|
'Lidia', 'Luisa', 'Lilo', 'Lenya', 'Lion', 'Luigi', 'Leandra', 'Linya', 'Lenius', 'Lisa', 'Leonardo', 'Lore', 'Laureen', 'Lilly', 'Lennard']
|
146
146
|
|
147
147
|
b = [ 'Liam', 'Lolomai', 'Livian', 'Levin', 'Lian', 'Luise', 'Ljubow', 'Leana', 'Lorita', 'Lena', 'Lensi', 'Livio', 'Lorraine', 'Liana', 'Linus',
|
148
|
-
'Lady', 'Leslie', 'Lennet', 'Lorna', 'Levi', 'Leonie', 'Linna', '
|
149
|
-
'
|
148
|
+
'Lady', 'Leslie', 'Lennet', 'Lorna', 'Levi', 'Leonie', 'Linna', 'Léan', 'Lucill', 'Laurence', 'Luk', 'Laurin', 'Leonharda', 'Liane',
|
149
|
+
'László', 'Lucia', 'Lúthien', 'Lene', 'Lukas', 'Lambert', 'Lissy', 'Lykka', 'Lothar', 'Lilian', 'Liv', 'Lina', 'Laura', 'Lientje', 'Lotta',
|
150
150
|
'Lynn', 'Levent', 'Lea', 'Lysander', 'Laurens', 'Lance', 'Lucie', 'Lionel', 'Leonore', 'Leni', 'Larry', 'Lale', 'Laurent', 'Leontine', 'Lara',
|
151
151
|
'Larissa', 'Leandro', 'Leyla', 'Lamprecht', 'Ljilja', 'Liz', 'Line', 'Ludwig', 'Lloyd', 'Lotte', 'Leonhard', 'Laurentius', 'Lenn', 'Lodewijk',
|
152
152
|
'Leif', 'Lieselotte', 'Louis', 'Lenelies', 'Lioba', 'Leticia', 'Lennart', 'Lizzy', 'Lorenz', 'Lei', 'Luis', 'Levke', 'Laurenz', 'Lorcan',
|
153
153
|
'Lucius', 'Levente', 'Louisa', 'Lutz', 'Liria', 'Lucy', 'Lilli', 'Ludmilla', 'Lewin', 'Linn', 'Luciano', 'Laje', 'Laetitia', 'Len',
|
154
154
|
'Louise', 'Lasse', 'Liselotte', 'Linda', 'Leona', 'Lieven', 'Lunis', 'Lisanne', 'Leo', 'Laijana', 'Luitgard', 'Lais', 'Lyn', 'Leolas',
|
155
155
|
'Larina', 'Leonard', 'Lia', 'Lutricia', 'Luka', 'Latif', 'Laatvik', 'Lenja', 'Lienhard', 'Leila', 'Ljudmila', 'Lukaja', 'Leiderat',
|
156
|
-
'Livia', 'Leah', 'Lenio', 'Luna', 'Lennox', 'Lilith', '
|
156
|
+
'Livia', 'Leah', 'Lenio', 'Luna', 'Lennox', 'Lilith', 'Ljubiša', 'Lauritz', 'Lili', 'Ljiljana', 'Lydia', 'Leon', 'Leilani', 'Lorena',
|
157
157
|
'Lenore', 'Lenny', 'Lola', 'Liska', 'Lars', 'Luke', 'Lacey', 'Loris', 'Laila', 'Ludger', 'Lev', 'Loreley', 'Leoni', 'Luana', 'Larees',
|
158
158
|
'Laurentia', 'Lidwina', 'Lakambini', 'Leander', 'Liah', 'Langer', 'Luca', 'Lucas', 'Lajos', 'Linnea', 'Laurie', 'Lana', 'Luc',
|
159
159
|
'Letizia', 'Lion', 'Lenya', 'Lilo', 'Luisa', 'Lidia', 'Lenius', 'Linya', 'Leandra', 'Luigi', 'Lennard', 'Lilly', 'Laureen',
|
@@ -161,22 +161,23 @@ class TestKyaniteSet < UnitTest
|
|
161
161
|
|
162
162
|
assert_equal a.sort, b.sort
|
163
163
|
assert_equal a.sort.hash, b.sort.hash
|
164
|
-
assert_not_equal a.to_set.hash, b.to_set.hash
|
165
164
|
assert_equal a.to_set, b.to_set
|
166
165
|
|
167
|
-
|
168
|
-
# Hier funktioniert Set nicht !!!
|
169
166
|
c = Set.new
|
170
167
|
c << a.to_set
|
171
168
|
c << b.to_set
|
172
|
-
|
173
|
-
|
169
|
+
assert_equal 1, c.size
|
170
|
+
|
171
|
+
#ap c
|
172
|
+
|
173
|
+
|
174
|
+
#assert_equal 2, c.size
|
174
175
|
|
175
176
|
# puts
|
176
177
|
# c.each do |e|
|
177
|
-
#
|
178
|
+
# ap e.hash
|
178
179
|
# end
|
179
|
-
|
180
|
+
|
180
181
|
|
181
182
|
|
182
183
|
|