Project

General

Profile

Actions

Defect #31507

closed

Test fails if trailing whitespaces are removed

Added by Marius BĂLTEANU almost 5 years ago. Updated 3 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

The test test_partials_with_html_entities fails if the trailing whitespaces are removed. The attached patch can be used to reproduce the below problem:


notroot@eb7d0b73147d:/work$ ruby test/unit/lib/redmine/unified_diff_test.rb -n test_partials_with_html_entities
DEPRECATION WARNING: `secrets.secret_token` is deprecated in favor of `secret_key_base` and will be removed in Rails 6.0. (called from <top (required)> at /work/config/environment.rb:16)
Run options: -n test_partials_with_html_entities --seed 55482

# Running:

E

Error:
Redmine::UnifiedDiffTest#test_partials_with_html_entities:
NoMethodError: undefined method `html_line_left' for nil:NilClass
    test/unit/lib/redmine/unified_diff_test.rb:106:in `test_partials_with_html_entities'

bin/rails test test/unit/lib/redmine/unified_diff_test.rb:92

I wasn't able to fix the test without changing the diff, any solution is welcome.


Files

0001-Remove-trailing-whitespaces-freom-test_partials_with.patch (862 Bytes) 0001-Remove-trailing-whitespaces-freom-test_partials_with.patch Marius BĂLTEANU, 2019-06-03 22:04
fix-31507.patch (757 Bytes) fix-31507.patch Go MAEDA, 2019-06-07 14:00
31507.patch (798 Bytes) 31507.patch Go MAEDA, 2024-01-28 09:19
31507-v2.patch (2.88 KB) 31507-v2.patch Go MAEDA, 2024-01-28 09:29

Related issues

Related to Redmine - Patch #31506: Remove trailing whitespacesClosedGo MAEDA

Actions
Actions #1

Updated by Marius BĂLTEANU almost 5 years ago

  • Description updated (diff)
Actions #2

Updated by Marius BĂLTEANU almost 5 years ago

  • Related to Patch #31506: Remove trailing whitespaces added
Actions #3

Updated by Go MAEDA almost 5 years ago

Here is my patch. I could not think of any other solution.

Actions #4

Updated by Go MAEDA 3 months ago

The problem can be fixed with the attached patch. The patch changes the test data not to include blank lines.

Actions #5

Updated by Go MAEDA 3 months ago

This new patch also fixes another two tests, test_keep_similar_git_footer_line and test_git_footer_line, and removes trailing white spaces.

Actions #6

Updated by Go MAEDA 3 months ago

  • Target version set to 6.0.0

Setting the target version to 6.0.0.

Actions #7

Updated by Go MAEDA 3 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix in r22679.

Actions

Also available in: Atom PDF