[dart] Add multi-line string example

This commit is contained in:
Andreas Dangel 2019-05-25 19:18:09 +02:00
parent 806b130e4a
commit a1a13b6234
2 changed files with 13 additions and 2 deletions

View File

@ -5,6 +5,7 @@
package net.sourceforge.pmd.cpd;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collection;
@ -39,7 +40,8 @@ public class DartTokenizerTest extends AbstractTokenizerTest {
new Object[] { "regex.dart", 13 },
new Object[] { "regex2.dart", 13 },
new Object[] { "regex3.dart", 13 },
new Object[] { "string_with_backslashes.dart", 9 }
new Object[] { "string_with_backslashes.dart", 9 },
new Object[] { "string_multiline.dart", 13 }
);
}
@ -52,7 +54,7 @@ public class DartTokenizerTest extends AbstractTokenizerTest {
@Override
public String getSampleCode() throws IOException {
return IOUtils.toString(DartTokenizer.class.getResourceAsStream(this.filename));
return IOUtils.toString(DartTokenizer.class.getResourceAsStream(this.filename), StandardCharsets.UTF_8);
}
@Test

View File

@ -0,0 +1,9 @@
class MyClass {
var s1 = '''
You can create
multi-line strings like this one.
''';
var s2 = """This is also a
multi-line string.""";
}