1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
$:.unshift "../lib/"
require 'th_mauve'
require 'mauve/configuration'
class TcMauveConfiguration < Mauve::UnitTest
include Mauve
def setup
setup_logger
end
def teardown
teardown_logger
end
def test_parse_range
[
[[1.0...2.0], 1],
[[1.0...3.0], 1..2],
[[1.0...2.0], 1...2],
[[1.0...2.0, 4.0...7.0], [1, 4..6]],
[[1.0..1.0], 1.0],
[[1.0..2.0], 1.0..2.0],
[[1.0...2.0], 1.0...2.0],
[[1.0..1.0, 4.0..6.0], [1.0, 4.0..6.0]],
[[7.0...24.0, 0.0...7.0], 7..6],
[[6.0...7.0, 0.0...1.0], 6..0, 0...7],
[["x".."z", "a".."c"], "x".."c", "a".."z"]
].each do |output, *input|
assert_equal(output, Configuration.parse_range(*input))
end
end
end
|