mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-17 03:13:11 +00:00
6876782: two javadoc tests fail on Windows
Reviewed-by: darcy
This commit is contained in:
parent
944568ba4b
commit
e4158efc0e
@ -123,6 +123,14 @@ public abstract class JavadocTester {
|
||||
*/
|
||||
private static int javadocRunNum = 0;
|
||||
|
||||
/**
|
||||
* Whether or not to match newlines exactly.
|
||||
* Set this value to false if the match strings
|
||||
* contain text from javadoc comments containing
|
||||
* non-platform newlines.
|
||||
*/
|
||||
protected boolean exactNewlineMatch = true;
|
||||
|
||||
/**
|
||||
* Construct a JavadocTester.
|
||||
*/
|
||||
@ -419,15 +427,22 @@ public abstract class JavadocTester {
|
||||
/**
|
||||
* Search for the string in the given file and return true
|
||||
* if the string was found.
|
||||
* If exactNewlineMatch is false, newlines will be normalized
|
||||
* before the comparison.
|
||||
*
|
||||
* @param fileString the contents of the file to search through
|
||||
* @param stringToFind the string to search for
|
||||
* @return true if the string was found
|
||||
*/
|
||||
private boolean findString(String fileString, String stringToFind) {
|
||||
return fileString.indexOf(stringToFind) >= 0;
|
||||
if (exactNewlineMatch) {
|
||||
return fileString.indexOf(stringToFind) >= 0;
|
||||
} else {
|
||||
return fileString.replace(NL, "\n").indexOf(stringToFind.replace(NL, "\n")) >= 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the standard output.
|
||||
* @return the standard output
|
||||
|
||||
@ -351,6 +351,7 @@ public class TestHtmlDefinitionListTag extends JavadocTester {
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
TestHtmlDefinitionListTag tester = new TestHtmlDefinitionListTag();
|
||||
tester.exactNewlineMatch = false;
|
||||
run(tester, ARGS1, TEST_ALL, NEGATED_TEST);
|
||||
run(tester, ARGS1, TEST_CMNT_DEPR, NEGATED_TEST);
|
||||
run(tester, ARGS2, TEST_ALL, NEGATED_TEST);
|
||||
|
||||
@ -128,6 +128,7 @@ public class TestSerializedFormDeprecationInfo extends JavadocTester {
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
TestSerializedFormDeprecationInfo tester = new TestSerializedFormDeprecationInfo();
|
||||
tester.exactNewlineMatch = false;
|
||||
run(tester, ARGS1, TEST_CMNT_DEPR, TEST_NOCMNT);
|
||||
run(tester, ARGS2, TEST_NOCMNT, TEST_CMNT_DEPR);
|
||||
run(tester, ARGS3, TEST_NODEPR, TEST_NOCMNT_NODEPR);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user