[dart] Add multi-line string example
This commit is contained in:
@ -5,6 +5,7 @@
|
|||||||
package net.sourceforge.pmd.cpd;
|
package net.sourceforge.pmd.cpd;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
||||||
@ -39,7 +40,8 @@ public class DartTokenizerTest extends AbstractTokenizerTest {
|
|||||||
new Object[] { "regex.dart", 13 },
|
new Object[] { "regex.dart", 13 },
|
||||||
new Object[] { "regex2.dart", 13 },
|
new Object[] { "regex2.dart", 13 },
|
||||||
new Object[] { "regex3.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
|
@Override
|
||||||
public String getSampleCode() throws IOException {
|
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
|
@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.""";
|
||||||
|
}
|
Reference in New Issue
Block a user