mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-24 05:47:33 +00:00
tests: fix stdlib test
https://github.com/plantuml/plantuml/pull/1692#issuecomment-1952831187
This commit is contained in:
parent
c6f9684026
commit
be69889e7f
2
.gitignore
vendored
2
.gitignore
vendored
@ -8,7 +8,7 @@
|
|||||||
out
|
out
|
||||||
|
|
||||||
#vscode files
|
#vscode files
|
||||||
/bin
|
**/bin/
|
||||||
|
|
||||||
# Ant result file
|
# Ant result file
|
||||||
plantuml.jar
|
plantuml.jar
|
||||||
|
@ -3,10 +3,13 @@ package net.sourceforge.plantuml.preproc;
|
|||||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.InputStreamReader;
|
import java.io.InputStreamReader;
|
||||||
@ -317,9 +320,12 @@ public class Stdlib {
|
|||||||
return new BrotliInputStream(raw);
|
return new BrotliInputStream(raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static InputStream getInternalInputStream(String fullname, String extension) {
|
private static InputStream getInternalInputStream(String fullname, String extension) throws FileNotFoundException {
|
||||||
final String res = "/stdlib/" + fullname + extension;
|
final String path = "stdlib/" + fullname + extension;
|
||||||
return Stdlib.class.getResourceAsStream(res);
|
InputStream result = Stdlib.class.getResourceAsStream("/" + path);
|
||||||
|
if (result == null)
|
||||||
|
result = new BufferedInputStream(new FileInputStream(path));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void extractStdLib() throws IOException {
|
public static void extractStdLib() throws IOException {
|
||||||
|
@ -32,8 +32,7 @@ class EaterTest {
|
|||||||
"'@startuml\n!$a=[1, 2, 3]\ntitle xx $a[2] yy\na -> a\n' , xx 3 yy",
|
"'@startuml\n!$a=[1, 2, 3]\ntitle xx $a[2] yy\na -> a\n' , xx 3 yy",
|
||||||
"'@startuml\ntitle\n!foreach $i in [1, 2, 3]\nxx $i yy\n!endfor\nendtitle\na -> a\n' , xx 2 yy",
|
"'@startuml\ntitle\n!foreach $i in [1, 2, 3]\nxx $i yy\n!endfor\nendtitle\na -> a\n' , xx 2 yy",
|
||||||
"'@startuml\ntitle\n!foreach $i in [\"a\", \"b\", \"c\"]\nxx $i yy\n!endfor\nendtitle\na -> a\n' , xx b yy",
|
"'@startuml\ntitle\n!foreach $i in [\"a\", \"b\", \"c\"]\nxx $i yy\n!endfor\nendtitle\na -> a\n' , xx b yy",
|
||||||
// TODO: fix code to allow test to access on stdlib, the corresponding (not working) test is here:
|
"'@startuml\nstdlib\n@enduml', archimate",
|
||||||
// "'@startuml\nstdlib\n@enduml', archimate",
|
|
||||||
})
|
})
|
||||||
void Test_EaterTest(String input, String expected) throws Exception {
|
void Test_EaterTest(String input, String expected) throws Exception {
|
||||||
assertRenderExpectedOutput(input, expected);
|
assertRenderExpectedOutput(input, expected);
|
||||||
|
Loading…
Reference in New Issue
Block a user