test-unit 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,11 @@
1
+ === 2.0.5 / 2009-10-18
2
+
3
+ * 1 bug fixes
4
+ * [#27314] fix diff may raise an exception. [Erik Hollensbe]
5
+
6
+ * Thanks
7
+ * Erik Hollensbe
8
+
1
9
  === 2.0.4 / 2009-10-17
2
10
 
3
11
  * 4 major enhancements
@@ -7,7 +15,7 @@
7
15
  http://test-unit.rubyforge.org/svn/trunk/images/color-diff.png
8
16
  * add Test::Unit::AutoRunner.default_runner= to specify default test runner.
9
17
 
10
- * 4 minor enchancements
18
+ * 4 minor enhancements
11
19
  * improve verbose mode output format. (use indent)
12
20
  * support NOT_PASS_THROUGH_EXCEPTIONS.
13
21
  * support arguments option in #{runner}_options.
data/README.txt CHANGED
@@ -46,7 +46,7 @@ This software is distributed under the same terms as ruby.
46
46
 
47
47
  * Daniel Berger: Suggestions and bug reports.
48
48
  * Designing Patterns: Suggestions.
49
- * Erik Hollensbe: Suggestions.
49
+ * Erik Hollensbe: Suggestions and bug reports.
50
50
  * Bill Lear: A suggestion.
51
51
  * Diego Pettenò: A bug report.
52
52
  * Angelo Lakra: A bug report.
@@ -495,6 +495,8 @@ module Test
495
495
  info = find_diff_line_info(from_start, from_end, to_start, to_end)
496
496
  best_ratio, from_equal_index, to_equal_index, *info = info
497
497
  from_best_index, to_best_index = info
498
+ from_best_index ||= from_start
499
+ to_best_index ||= to_start
498
500
 
499
501
  if best_ratio < cut_off_ratio
500
502
  if from_equal_index.nil?
@@ -2,6 +2,6 @@
2
2
  # HACK: quick and dirty to get integrated into the new project - ryan
3
3
  module Test
4
4
  module Unit
5
- VERSION = '2.0.4'
5
+ VERSION = '2.0.5'
6
6
  end
7
7
  end
data/test/test-diff.rb CHANGED
@@ -194,6 +194,21 @@ class TestUnitDiff < Test::Unit::TestCase
194
194
  assert_ratio(0.80, "efg", "eg")
195
195
  end
196
196
 
197
+ def test_1_length_readable_diff
198
+ differ = Test::Unit::Diff::ReadableDiffer.new(["0"], ["1"])
199
+ def differ.cut_off_ratio
200
+ 0
201
+ end
202
+ def differ.default_ratio
203
+ 0
204
+ end
205
+ assert_equal("- 0\n" +
206
+ "? ^\n" +
207
+ "+ 1\n" +
208
+ "? ^",
209
+ differ.diff.join("\n"))
210
+ end
211
+
197
212
  def test_same_contents_readable_diff
198
213
  assert_readable_diff(" aaa", ["aaa"], ["aaa"])
199
214
  assert_readable_diff(" aaa\n" \
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-unit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2009-10-17 00:00:00 +09:00
13
+ date: 2009-10-18 00:00:00 +09:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency