Use OS independant line separator (PMD.EOL) in EcmascriptTokenizerTest

This commit is contained in:
Dmitry Kurelchuk
2017-01-29 13:24:28 +02:00
parent e01951a63d
commit 769935ad4c

View File

@ -115,30 +115,30 @@ public class EcmascriptTokenizerTest {
public void testTemplateStrings() throws IOException { public void testTemplateStrings() throws IOException {
Tokenizer t = new EcmascriptTokenizer(); Tokenizer t = new EcmascriptTokenizer();
SourceCode sourceCode = new SourceCode(new SourceCode.StringCodeLoader( SourceCode sourceCode = new SourceCode(new SourceCode.StringCodeLoader(
"export default class DrawLocation extends joint.shapes.basic.Generic {\n" "export default class DrawLocation extends joint.shapes.basic.Generic {" + PMD.EOL
+ " constructor(location: ILocation) {\n" + " constructor(location: ILocation) {" + PMD.EOL
+ " this.markup = `<g>\n" + " this.markup = `<g>" + PMD.EOL
+ " <path class=\"location\"/>\n" + " <path class=\"location\"/>" + PMD.EOL
+ " <text x=\"0\" y=\"0\" text-anchor=\"middle\" class=\"location-text\"></text>\n" + " <text x=\"0\" y=\"0\" text-anchor=\"middle\" class=\"location-text\"></text>" + PMD.EOL
+ "\n" + PMD.EOL
+ " <path class=\"location\"/>\n" + " <path class=\"location\"/>" + PMD.EOL
+ " <circle class=\"location-circle\"/>\n" + " <circle class=\"location-circle\"/>" + PMD.EOL
+ " ${drawIndicators.Check.markup}\n" + " ${drawIndicators.Check.markup}" + PMD.EOL
+ "\n" + PMD.EOL
+ " </g>`;\n" + " </g>`;" + PMD.EOL
+ " }\n" + " }" + PMD.EOL
+ "\n" + "" + PMD.EOL
+ "}")); + "}"));
final Tokens tokens = new Tokens(); final Tokens tokens = new Tokens();
t.tokenize(sourceCode, tokens); t.tokenize(sourceCode, tokens);
final String templateString = "`<g>\n" final String templateString = "`<g>" + PMD.EOL
+ " <path class=\"location\"/>\n" + " <path class=\"location\"/>" + PMD.EOL
+ " <text x=\"0\" y=\"0\" text-anchor=\"middle\" class=\"location-text\"></text>\n" + " <text x=\"0\" y=\"0\" text-anchor=\"middle\" class=\"location-text\"></text>" + PMD.EOL
+ "\n" + PMD.EOL
+ " <path class=\"location\"/>\n" + " <path class=\"location\"/>" + PMD.EOL
+ " <circle class=\"location-circle\"/>\n" + " <circle class=\"location-circle\"/>" + PMD.EOL
+ " ${drawIndicators.Check.markup}\n" + " ${drawIndicators.Check.markup}" + PMD.EOL
+ "\n" + PMD.EOL
+ " </g>`"; + " </g>`";
assertEquals(templateString, tokens.getTokens().get(24).toString()); assertEquals(templateString, tokens.getTokens().get(24).toString());
} }