[dart] Add multi-line string example
This commit is contained in:
parent
806b130e4a
commit
a1a13b6234
@ -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
|
||||
|
@ -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.""";
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user