|
24 | 24 | import java.io.File; |
25 | 25 | import java.io.IOException; |
26 | 26 | import java.io.Reader; |
| 27 | +import java.io.UncheckedIOException; |
27 | 28 | import java.nio.charset.StandardCharsets; |
28 | 29 | import java.nio.file.FileVisitResult; |
29 | 30 | import java.nio.file.Files; |
|
42 | 43 | import javax.script.Compilable; |
43 | 44 | import javax.script.ScriptEngineManager; |
44 | 45 | import javax.script.ScriptException; |
| 46 | +import org.apache.commons.io.IOUtils; |
45 | 47 | import org.apache.commons.lang3.SystemUtils; |
46 | 48 | import org.apache.commons.lang3.mutable.MutableInt; |
47 | 49 | import org.codehaus.groovy.jsr223.GroovyScriptEngineFactory; |
|
51 | 53 | import org.junit.jupiter.params.ParameterizedTest; |
52 | 54 | import org.junit.jupiter.params.provider.Arguments; |
53 | 55 | import org.junit.jupiter.params.provider.MethodSource; |
| 56 | +import org.mozilla.zest.core.v1.ZestJSON; |
| 57 | +import org.mozilla.zest.core.v1.ZestScript; |
54 | 58 | import org.python.core.Options; |
55 | 59 | import org.python.jsr223.PyScriptEngineFactory; |
56 | 60 |
|
@@ -116,9 +120,16 @@ private static Stream<Arguments> scriptsRuby() { |
116 | 120 | } |
117 | 121 |
|
118 | 122 | private static Stream<Arguments> scriptsZest() { |
119 | | - // Just collect the files for now (Issue 114). |
120 | | - getFilesWithExtension(".zst"); |
121 | | - return Stream.empty(); |
| 123 | + return testData( |
| 124 | + ".zst", |
| 125 | + reader -> { |
| 126 | + try { |
| 127 | + assertThat(ZestJSON.fromString(IOUtils.toString(reader))) |
| 128 | + .isInstanceOf(ZestScript.class); |
| 129 | + } catch (IOException e) { |
| 130 | + throw new UncheckedIOException(e); |
| 131 | + } |
| 132 | + }); |
122 | 133 | } |
123 | 134 |
|
124 | 135 | private static Stream<Arguments> testData(String extension, Compilable engine) { |
|
0 commit comments