cmpfs-ruby 0.2.0 → 0.2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE +17 -16
- data/README.md +133 -11
- data/examples/compare_two_binary_files.rb +44 -0
- data/examples/compare_two_text_files.rb +44 -0
- data/lib/cmpfs/compare/api_1_9.rb +142 -120
- data/lib/cmpfs/compare/api_2.rb +130 -108
- data/lib/cmpfs/compare/binary/internal_.rb +50 -52
- data/lib/cmpfs/compare/text/internal_.rb +89 -92
- data/lib/cmpfs/compare.rb +25 -23
- data/lib/cmpfs/version.rb +20 -19
- data/lib/cmpfs.rb +22 -18
- data/test/unit/compare/tc_compare_binary.rb +52 -51
- data/test/unit/compare/ts_all.rb +1 -1
- data/test/unit/tc_compare_binary.rb +53 -54
- data/test/unit/tc_compare_text.rb +85 -31
- data/test/unit/tc_version.rb +19 -16
- data/test/unit/ts_all.rb +1 -1
- metadata +24 -17
data/lib/cmpfs/compare.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
|
2
2
|
# ######################################################################## #
|
3
|
-
# File:
|
3
|
+
# File: cmpfs/version.rb
|
4
4
|
#
|
5
|
-
# Purpose:
|
5
|
+
# Purpose: Version for cmpfs.Ruby library
|
6
6
|
#
|
7
|
-
# Created:
|
8
|
-
# Updated:
|
7
|
+
# Created: 1st March 2019
|
8
|
+
# Updated: 1st April 2024
|
9
9
|
#
|
10
|
-
# Home:
|
10
|
+
# Home: http://github.com/synesissoftware/cmpfs.Ruby
|
11
11
|
#
|
12
|
-
# Author:
|
12
|
+
# Author: Matthew Wilson
|
13
13
|
#
|
14
|
+
# Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
|
14
15
|
# Copyright (c) 2019, Matthew Wilson and Synesis Software
|
15
16
|
# All rights reserved.
|
16
17
|
#
|
@@ -46,12 +47,13 @@
|
|
46
47
|
|
47
48
|
if RUBY_VERSION >= '2'
|
48
49
|
|
49
|
-
|
50
|
+
require 'cmpfs/compare/api_2'
|
50
51
|
else
|
51
52
|
|
52
|
-
|
53
|
+
require 'cmpfs/compare/api_1_9'
|
53
54
|
end
|
54
55
|
|
56
|
+
|
55
57
|
=begin
|
56
58
|
=end
|
57
59
|
|
@@ -73,32 +75,32 @@ module CmpFS
|
|
73
75
|
#
|
74
76
|
module Compare
|
75
77
|
|
76
|
-
|
78
|
+
def self.extended receiver
|
77
79
|
|
78
|
-
|
80
|
+
receiver.class_eval do
|
79
81
|
|
80
|
-
|
81
|
-
|
82
|
+
extend CmpFS_Compare_Methods
|
83
|
+
end
|
82
84
|
|
83
|
-
|
84
|
-
|
85
|
+
$stderr.puts "#{receiver} extended by #{CmpFS_Compare_Methods}" if $DEBUG
|
86
|
+
end
|
85
87
|
|
86
|
-
|
88
|
+
def self.included receiver
|
87
89
|
|
88
|
-
|
90
|
+
receiver.class_eval do
|
89
91
|
|
90
|
-
|
91
|
-
|
92
|
+
include CmpFS_Compare_Methods
|
93
|
+
end
|
92
94
|
|
93
|
-
|
94
|
-
|
95
|
+
$stderr.puts "#{receiver} included #{CmpFS_Compare_Methods}" if $DEBUG
|
96
|
+
end
|
95
97
|
|
96
|
-
|
97
|
-
|
98
|
+
extend CmpFS_Compare_Methods
|
99
|
+
include CmpFS_Compare_Methods
|
98
100
|
|
99
101
|
end # module Compare
|
100
102
|
end # module CmpFS
|
101
103
|
|
102
|
-
# ############################## end of file ############################# #
|
103
104
|
|
105
|
+
# ############################## end of file ############################# #
|
104
106
|
|
data/lib/cmpfs/version.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
|
2
2
|
# ######################################################################## #
|
3
|
-
# File:
|
3
|
+
# File: cmpfs/version.rb
|
4
4
|
#
|
5
|
-
# Purpose:
|
5
|
+
# Purpose: Version for cmpfs.Ruby library
|
6
6
|
#
|
7
|
-
# Created:
|
8
|
-
# Updated:
|
7
|
+
# Created: 1st March 2019
|
8
|
+
# Updated: 2nd April 2024
|
9
9
|
#
|
10
|
-
# Home:
|
10
|
+
# Home: http://github.com/synesissoftware/cmpfs.Ruby
|
11
11
|
#
|
12
|
-
# Author:
|
12
|
+
# Author: Matthew Wilson
|
13
13
|
#
|
14
|
+
# Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
|
14
15
|
# Copyright (c) 2019, Matthew Wilson and Synesis Software
|
15
16
|
# All rights reserved.
|
16
17
|
#
|
@@ -49,23 +50,23 @@
|
|
49
50
|
|
50
51
|
module CmpFS
|
51
52
|
|
52
|
-
|
53
|
-
|
53
|
+
# Current version of the cmpfs.Ruby library
|
54
|
+
VERSION = '0.2.1.2'
|
54
55
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
56
|
+
private
|
57
|
+
VERSION_PARTS_ = VERSION.split(/[.]/).collect { |n| n.to_i } # :nodoc:
|
58
|
+
public
|
59
|
+
# Major version of the cmpfs.Ruby library
|
60
|
+
VERSION_MAJOR = VERSION_PARTS_[0] # :nodoc:
|
61
|
+
# Minor version of the cmpfs.Ruby library
|
62
|
+
VERSION_MINOR = VERSION_PARTS_[1] # :nodoc:
|
63
|
+
# Revision version of the cmpfs.Ruby library
|
64
|
+
VERSION_PATCH = VERSION_PARTS_[2] # :nodoc:
|
64
65
|
|
65
|
-
|
66
|
+
VERSION_REVISION = VERSION_PATCH # :nodoc:
|
66
67
|
|
67
68
|
end # module CmpFS
|
68
69
|
|
69
|
-
# ############################## end of file ############################# #
|
70
70
|
|
71
|
+
# ############################## end of file ############################# #
|
71
72
|
|
data/lib/cmpfs.rb
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
|
2
2
|
# ######################################################################## #
|
3
|
-
# File:
|
3
|
+
# File: cmpfs.rb
|
4
4
|
#
|
5
|
-
# Purpose:
|
5
|
+
# Purpose: Primary require for cmpfs.Ruby library
|
6
6
|
#
|
7
|
-
# Created:
|
8
|
-
# Updated:
|
7
|
+
# Created: 1st March 2019
|
8
|
+
# Updated: 2nd April 2024
|
9
9
|
#
|
10
|
-
# Home:
|
10
|
+
# Home: http://github.com/synesissoftware/cmpfs.Ruby
|
11
11
|
#
|
12
|
-
# Author:
|
12
|
+
# Author: Matthew Wilson
|
13
13
|
#
|
14
|
+
# Copyright (c) 2019-2024, Matthew Wilson and Synesis Information Systems
|
14
15
|
# Copyright (c) 2019, Matthew Wilson and Synesis Software
|
15
16
|
# All rights reserved.
|
16
17
|
#
|
@@ -53,25 +54,28 @@ require 'cmpfs/version'
|
|
53
54
|
## Root module for *cmpfs*
|
54
55
|
module CmpFS
|
55
56
|
|
56
|
-
|
57
|
+
def self.extended receiver
|
57
58
|
|
58
|
-
|
59
|
+
receiver.class_eval do
|
59
60
|
|
60
|
-
|
61
|
-
|
61
|
+
extend CmpFS::Compare
|
62
|
+
end
|
62
63
|
|
63
|
-
|
64
|
-
|
64
|
+
$stderr.puts "#{receiver} extended by #{CmpFS}" if $DEBUG
|
65
|
+
end
|
65
66
|
|
66
|
-
|
67
|
+
def self.included receiver
|
67
68
|
|
68
|
-
|
69
|
+
receiver.class_eval do
|
69
70
|
|
70
|
-
|
71
|
-
|
71
|
+
include CmpFS::Compare
|
72
|
+
end
|
72
73
|
|
73
|
-
|
74
|
-
|
74
|
+
$stderr.puts "#{receiver} included #{CmpFS}" if $DEBUG
|
75
|
+
end
|
75
76
|
|
76
77
|
end # module CmpFS
|
77
78
|
|
79
|
+
|
80
|
+
# ############################## end of file ############################# #
|
81
|
+
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
#! /usr/bin/env ruby
|
2
2
|
|
3
3
|
$:.unshift File.join(File.dirname(__FILE__), '../../../lib')
|
4
4
|
|
@@ -10,94 +10,95 @@ require 'test/unit'
|
|
10
10
|
require 'stringio'
|
11
11
|
require 'tempfile'
|
12
12
|
|
13
|
+
|
13
14
|
class Test_CmpFS_Compare_compare_binary < Test::Unit::TestCase
|
14
15
|
|
15
|
-
|
16
|
+
def test__compare_binary__identical_1
|
16
17
|
|
17
|
-
|
18
|
-
|
18
|
+
lhs = StringIO.new 'abcdefghijiklmno'
|
19
|
+
rhs_eq = StringIO.new 'abcdefghijiklmno'
|
19
20
|
|
20
|
-
|
21
|
+
assert CmpFS::Compare.compare_binary(lhs, rhs_eq), 'streams should be the same'
|
21
22
|
|
22
|
-
|
23
|
+
rhs_ne = StringIO.new 'abcdefghijiklmn'
|
23
24
|
|
24
|
-
|
25
|
-
|
25
|
+
assert_false CmpFS::Compare.compare_binary(lhs, rhs_ne), 'streams should not be the same'
|
26
|
+
end
|
26
27
|
|
27
|
-
|
28
|
+
def test__compare_binary__identical_2
|
28
29
|
|
29
|
-
|
30
|
+
lhs_f = Tempfile.new('compare_binary-2')
|
30
31
|
|
31
|
-
|
32
|
+
begin
|
32
33
|
|
33
|
-
|
34
|
+
lhs_f << 'abcdefghijiklmno'
|
34
35
|
|
35
|
-
|
36
|
-
|
36
|
+
lhs_f.rewind
|
37
|
+
lhs_f.close
|
37
38
|
|
38
|
-
|
39
|
+
rhs_eq = StringIO.new 'abcdefghijiklmno'
|
39
40
|
|
40
|
-
|
41
|
+
assert CmpFS::Compare.compare_binary(lhs_f.path, rhs_eq), 'streams should be the same'
|
41
42
|
|
42
|
-
|
43
|
+
rhs_ne = StringIO.new 'abcdefghijiklmnop'
|
43
44
|
|
44
|
-
|
45
|
-
|
45
|
+
assert_false CmpFS::Compare.compare_binary(lhs_f.path, rhs_ne), 'streams should not be the same'
|
46
|
+
ensure
|
46
47
|
|
47
|
-
|
48
|
-
|
49
|
-
|
48
|
+
lhs_f.unlink
|
49
|
+
end
|
50
|
+
end
|
50
51
|
|
51
|
-
|
52
|
+
def test__compare_binary__identical_3
|
52
53
|
|
53
|
-
|
54
|
+
lhs_f = Tempfile.new('compare_binary-3')
|
54
55
|
|
55
|
-
|
56
|
+
begin
|
56
57
|
|
57
|
-
|
58
|
+
lhs_f << 'abcdefghijiklmno'
|
58
59
|
|
59
|
-
|
60
|
-
|
60
|
+
lhs_f.rewind
|
61
|
+
lhs_f.close
|
61
62
|
|
62
63
|
|
63
|
-
|
64
|
+
rhs_eq_f = Tempfile.new('compare_binary-3')
|
64
65
|
|
65
|
-
|
66
|
+
begin
|
66
67
|
|
67
|
-
|
68
|
+
rhs_eq_f << 'abcdefghijiklmno'
|
68
69
|
|
69
|
-
|
70
|
-
|
70
|
+
rhs_eq_f.rewind
|
71
|
+
rhs_eq_f.close
|
71
72
|
|
72
|
-
|
73
|
-
|
73
|
+
assert CmpFS::Compare.compare_binary(lhs_f.path, rhs_eq_f.path), 'streams should be the same'
|
74
|
+
ensure
|
74
75
|
|
75
|
-
|
76
|
-
|
76
|
+
rhs_eq_f.unlink
|
77
|
+
end
|
77
78
|
|
78
79
|
|
79
|
-
|
80
|
+
rhs_ne_f = Tempfile.new('compare_binary-3')
|
80
81
|
|
81
|
-
|
82
|
+
begin
|
82
83
|
|
83
|
-
|
84
|
+
rhs_ne_f << 'xyz'
|
84
85
|
|
85
|
-
|
86
|
-
|
86
|
+
rhs_ne_f.rewind
|
87
|
+
rhs_ne_f.close
|
87
88
|
|
88
|
-
|
89
|
-
|
89
|
+
assert_false CmpFS::Compare.compare_binary(lhs_f.path, rhs_ne_f.path), 'streams should not be the same'
|
90
|
+
ensure
|
90
91
|
|
91
|
-
|
92
|
-
|
92
|
+
rhs_ne_f.unlink
|
93
|
+
end
|
93
94
|
|
94
|
-
|
95
|
+
ensure
|
95
96
|
|
96
|
-
|
97
|
-
|
98
|
-
|
97
|
+
lhs_f.unlink
|
98
|
+
end
|
99
|
+
end
|
99
100
|
end
|
100
101
|
|
101
|
-
# ############################## end of file ############################# #
|
102
102
|
|
103
|
+
# ############################## end of file ############################# #
|
103
104
|
|
data/test/unit/compare/ts_all.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
#! /usr/bin/env ruby
|
2
2
|
|
3
3
|
$:.unshift File.join(File.dirname(__FILE__), '../../lib')
|
4
4
|
|
@@ -10,98 +10,97 @@ require 'test/unit'
|
|
10
10
|
require 'stringio'
|
11
11
|
require 'tempfile'
|
12
12
|
|
13
|
-
class Test_CmpFS_compare_binary < Test::Unit::TestCase
|
14
|
-
|
15
|
-
include ::CmpFS
|
16
13
|
|
17
|
-
|
14
|
+
class Test_CmpFS_compare_binary < Test::Unit::TestCase
|
18
15
|
|
19
|
-
|
20
|
-
rhs_eq = StringIO.new 'abcdefghijiklmno'
|
16
|
+
include ::CmpFS
|
21
17
|
|
22
|
-
|
18
|
+
def test__compare_binary__identical_1
|
23
19
|
|
24
|
-
|
20
|
+
lhs = StringIO.new 'abcdefghijiklmno'
|
21
|
+
rhs_eq = StringIO.new 'abcdefghijiklmno'
|
25
22
|
|
26
|
-
|
27
|
-
end
|
23
|
+
assert compare_binary(lhs, rhs_eq), 'streams should be the same'
|
28
24
|
|
29
|
-
|
25
|
+
rhs_ne = StringIO.new 'abcdefghijiklmn'
|
30
26
|
|
31
|
-
|
27
|
+
assert_false compare_binary(lhs, rhs_ne), 'streams should not be the same'
|
28
|
+
end
|
32
29
|
|
33
|
-
|
30
|
+
def test__compare_binary__identical_2
|
34
31
|
|
35
|
-
|
32
|
+
lhs_f = Tempfile.new('compare_binary-2')
|
36
33
|
|
37
|
-
|
38
|
-
lhs_f.close
|
34
|
+
begin
|
39
35
|
|
40
|
-
|
36
|
+
lhs_f << 'abcdefghijiklmno'
|
41
37
|
|
42
|
-
|
38
|
+
lhs_f.rewind
|
39
|
+
lhs_f.close
|
43
40
|
|
44
|
-
|
41
|
+
rhs_eq = StringIO.new 'abcdefghijiklmno'
|
45
42
|
|
46
|
-
|
47
|
-
ensure
|
43
|
+
assert compare_binary(lhs_f.path, rhs_eq), 'streams should be the same'
|
48
44
|
|
49
|
-
|
50
|
-
end
|
51
|
-
end
|
45
|
+
rhs_ne = StringIO.new 'abcdefghijiklmnop'
|
52
46
|
|
53
|
-
|
47
|
+
assert_false compare_binary(lhs_f.path, rhs_ne), 'streams should not be the same'
|
48
|
+
ensure
|
54
49
|
|
55
|
-
|
50
|
+
lhs_f.unlink
|
51
|
+
end
|
52
|
+
end
|
56
53
|
|
57
|
-
|
54
|
+
def test__compare_binary__identical_3
|
58
55
|
|
59
|
-
|
56
|
+
lhs_f = Tempfile.new('compare_binary-3')
|
60
57
|
|
61
|
-
|
62
|
-
lhs_f.close
|
58
|
+
begin
|
63
59
|
|
60
|
+
lhs_f << 'abcdefghijiklmno'
|
64
61
|
|
65
|
-
|
62
|
+
lhs_f.rewind
|
63
|
+
lhs_f.close
|
66
64
|
|
67
|
-
begin
|
68
65
|
|
69
|
-
|
66
|
+
rhs_eq_f = Tempfile.new('compare_binary-3')
|
70
67
|
|
71
|
-
|
72
|
-
rhs_eq_f.close
|
68
|
+
begin
|
73
69
|
|
70
|
+
rhs_eq_f << 'abcdefghijiklmno'
|
74
71
|
|
75
|
-
|
76
|
-
|
72
|
+
rhs_eq_f.rewind
|
73
|
+
rhs_eq_f.close
|
77
74
|
|
78
|
-
|
79
|
-
|
75
|
+
assert compare_binary(lhs_f.path, rhs_eq_f.path), 'streams should be the same'
|
76
|
+
ensure
|
80
77
|
|
78
|
+
rhs_eq_f.unlink
|
79
|
+
end
|
81
80
|
|
82
|
-
rhs_ne_f = Tempfile.new('compare_binary-3')
|
83
81
|
|
84
|
-
|
82
|
+
rhs_ne_f = Tempfile.new('compare_binary-3')
|
85
83
|
|
86
|
-
|
84
|
+
begin
|
87
85
|
|
88
|
-
|
89
|
-
rhs_ne_f.close
|
86
|
+
rhs_ne_f << 'xyz'
|
90
87
|
|
88
|
+
rhs_ne_f.rewind
|
89
|
+
rhs_ne_f.close
|
91
90
|
|
92
|
-
|
93
|
-
|
91
|
+
assert_false compare_binary(lhs_f.path, rhs_ne_f.path), 'streams should not be the same'
|
92
|
+
ensure
|
94
93
|
|
95
|
-
|
96
|
-
|
94
|
+
rhs_ne_f.unlink
|
95
|
+
end
|
97
96
|
|
98
|
-
|
97
|
+
ensure
|
99
98
|
|
100
|
-
|
101
|
-
|
102
|
-
|
99
|
+
lhs_f.unlink
|
100
|
+
end
|
101
|
+
end
|
103
102
|
end
|
104
103
|
|
105
|
-
# ############################## end of file ############################# #
|
106
104
|
|
105
|
+
# ############################## end of file ############################# #
|
107
106
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
#! /usr/bin/env ruby
|
2
2
|
|
3
3
|
$:.unshift File.join(File.dirname(__FILE__), '../../lib')
|
4
4
|
|
@@ -10,56 +10,110 @@ require 'test/unit'
|
|
10
10
|
require 'stringio'
|
11
11
|
require 'tempfile'
|
12
12
|
|
13
|
+
|
13
14
|
class Test_CmpFS_compare_text < Test::Unit::TestCase
|
14
15
|
|
15
|
-
|
16
|
+
include ::CmpFS
|
17
|
+
|
18
|
+
def test__compare_text__empty
|
19
|
+
|
20
|
+
lhs = StringIO.new
|
21
|
+
rhs_eq = StringIO.new
|
22
|
+
|
23
|
+
assert compare_text(lhs, rhs_eq), 'streams should be the same'
|
24
|
+
end
|
25
|
+
|
26
|
+
def test__compare_text__blank_lines
|
27
|
+
|
28
|
+
lhs = StringIO.new <<END_OF_INPUT
|
29
|
+
|
30
|
+
|
31
|
+
END_OF_INPUT
|
32
|
+
rhs_eq = StringIO.new <<END_OF_INPUT
|
33
|
+
|
16
34
|
|
17
|
-
|
35
|
+
END_OF_INPUT
|
18
36
|
|
19
|
-
|
20
|
-
|
37
|
+
assert compare_text(lhs, rhs_eq), 'streams should be the same'
|
38
|
+
end
|
21
39
|
|
22
|
-
|
23
|
-
rhs_eq << "line-1\n"
|
40
|
+
def test__compare_text__identical_lines_1
|
24
41
|
|
25
|
-
|
26
|
-
|
42
|
+
lhs = StringIO.new <<END_OF_INPUT
|
43
|
+
line-1
|
44
|
+
line-2
|
27
45
|
|
28
|
-
|
46
|
+
END_OF_INPUT
|
47
|
+
rhs_eq = StringIO.new <<END_OF_INPUT
|
48
|
+
line-1
|
49
|
+
line-2
|
29
50
|
|
30
|
-
|
51
|
+
END_OF_INPUT
|
31
52
|
|
32
|
-
|
33
|
-
|
53
|
+
assert compare_text(lhs, rhs_eq), 'streams should be the same'
|
54
|
+
end
|
34
55
|
|
35
|
-
|
36
|
-
end
|
56
|
+
def test__compare_text__different_lines_1
|
37
57
|
|
38
|
-
|
58
|
+
lhs = StringIO.new <<END_OF_INPUT
|
59
|
+
line-1
|
60
|
+
line-2
|
39
61
|
|
40
|
-
|
41
|
-
|
62
|
+
END_OF_INPUT
|
63
|
+
rhs_ne = StringIO.new <<END_OF_INPUT
|
64
|
+
line-1
|
65
|
+
line2
|
42
66
|
|
43
|
-
|
44
|
-
lhs << "\n"
|
45
|
-
rhs_eq << "line-1\n"
|
67
|
+
END_OF_INPUT
|
46
68
|
|
47
|
-
|
48
|
-
|
69
|
+
assert_false compare_text(lhs, rhs_ne), 'streams should not be the same'
|
70
|
+
end
|
49
71
|
|
50
|
-
|
51
|
-
assert compare_text(lhs, rhs_eq, trim_lines: true, skip_blank_lines: true), 'streams should be the same'
|
72
|
+
def test__compare_text__different_lines_2
|
52
73
|
|
53
|
-
|
74
|
+
lhs = StringIO.new <<END_OF_INPUT
|
75
|
+
line-1
|
54
76
|
|
55
|
-
|
56
|
-
|
77
|
+
line-2
|
78
|
+
END_OF_INPUT
|
79
|
+
rhs_ne = StringIO.new <<END_OF_INPUT
|
80
|
+
line-1
|
81
|
+
line-2
|
57
82
|
|
58
|
-
|
59
|
-
end
|
83
|
+
END_OF_INPUT
|
60
84
|
|
85
|
+
assert_false compare_text(lhs, rhs_ne), 'streams should not be the same'
|
86
|
+
end
|
87
|
+
|
88
|
+
def test__compare_text__different_streams_with_permutations_of_trim_and_skip_1
|
89
|
+
|
90
|
+
lhs = StringIO.new <<END_OF_INPUT
|
91
|
+
line-1
|
92
|
+
|
93
|
+
line-2
|
94
|
+
END_OF_INPUT
|
95
|
+
rhs_eq = StringIO.new <<END_OF_INPUT
|
96
|
+
line-1
|
97
|
+
line-2
|
98
|
+
END_OF_INPUT
|
99
|
+
|
100
|
+
assert_false compare_text(lhs, rhs_eq), 'streams should not be the same'
|
101
|
+
assert_false compare_text(lhs, rhs_eq, trim_lines: false, skip_blank_lines: true), 'streams should not be the same'
|
102
|
+
assert_false compare_text(lhs, rhs_eq, trim_lines: true, skip_blank_lines: false), 'streams should not be the same'
|
103
|
+
assert compare_text(lhs, rhs_eq, trim_lines: true, skip_blank_lines: true), 'streams should be the same'
|
104
|
+
|
105
|
+
rhs_ne = StringIO.new <<END_OF_INPUT
|
106
|
+
line-1
|
107
|
+
line2
|
108
|
+
END_OF_INPUT
|
109
|
+
|
110
|
+
assert_false compare_text(lhs, rhs_ne), 'streams should not be the same'
|
111
|
+
assert_false compare_text(lhs, rhs_ne, trim_lines: false, skip_blank_lines: true), 'streams should not be the same'
|
112
|
+
assert_false compare_text(lhs, rhs_ne, trim_lines: true, skip_blank_lines: false), 'streams should not be the same'
|
113
|
+
assert_false compare_text(lhs, rhs_ne, trim_lines: true, skip_blank_lines: true), 'streams should not be the same'
|
114
|
+
end
|
61
115
|
end
|
62
116
|
|
63
|
-
# ############################## end of file ############################# #
|
64
117
|
|
118
|
+
# ############################## end of file ############################# #
|
65
119
|
|