This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 220070 - HintTest.AppliedFix assertOutput(String code) method considers \r characters when comparing the sources
Summary: HintTest.AppliedFix assertOutput(String code) method considers \r characters ...
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords: TEST
Depends on:
Blocks:
 
Reported: 2012-10-14 16:30 UTC by maks_t34
Modified: 2012-10-20 01:29 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (99.04 KB, text/plain)
2012-10-14 16:30 UTC, maks_t34
Details

Note You need to log in before you can comment on or make changes to this bug.
Description maks_t34 2012-10-14 16:30:08 UTC
Product Version = NetBeans IDE 7.3 Beta (Build 201210011125)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.6.0_26
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.1-b02

org.​netbeans.​modules.​java.​hints.​test.​api.​HintTest.AppliedFix assertOutput(String code)  method considers \r characters when comparing the sources

I propose (at least) to change the lines 968-968 of HintTest.java from

            //ignore whitespaces:
            realCode = realCode.replaceAll("[ \t\n]+", " ");

            assertEquals("The output code does not match the expected code.", code.replaceAll("[ \t\n]+", " "), realCode);

to

            //ignore whitespaces:
            realCode = realCode.replaceAll("[ \t\n\r]+", " ");

            assertEquals("The output code does not match the expected code.", code.replaceAll("[ \t\n\r]+", " "), realCode);
Comment 1 maks_t34 2012-10-14 16:30:14 UTC
Created attachment 125939 [details]
IDE log
Comment 2 Jan Lahoda 2012-10-19 18:11:12 UTC
I got carried away a little bit, and implemented using code points - hope it will work correctly:
http://hg.netbeans.org/jet-main/rev/d6006f1a8952
Comment 3 Quality Engineering 2012-10-20 01:29:19 UTC
Integrated into 'main-golden', will be available in build *201210200002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/d6006f1a8952
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #220070: HintTest.assertOutput should strip all whitespaces, not only space, newline and tabulator.