File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
src/test/java/org/scijava/script Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 3535import static org .junit .Assert .assertTrue ;
3636import static org .junit .Assert .fail ;
3737
38+ import java .io .BufferedReader ;
3839import java .io .File ;
3940import java .io .IOException ;
4041import java .io .Reader ;
@@ -124,6 +125,26 @@ public void testVersion() throws IOException {
124125 FileUtils .deleteRecursively (tmpDir );
125126 }
126127
128+ /**
129+ * Ensures the ScriptInfos Reader can be reused for multiple executions of the
130+ * script.
131+ */
132+ @ Test
133+ public void testReaderSanity () throws Exception {
134+ final String script = "" + //
135+ "% @LogService log\n " + //
136+ "% @OUTPUT Integer output" ;
137+
138+ ScriptInfo info = new ScriptInfo (context , "hello.bsizes" , new StringReader (
139+ script ));
140+ BufferedReader reader1 = info .getReader ();
141+ BufferedReader reader2 = info .getReader ();
142+
143+ assertEquals ("Readers are not independent." , reader1 .read (), reader2
144+ .read ());
145+
146+ }
147+
127148 @ Plugin (type = ScriptLanguage .class )
128149 public static class BindingSizes extends AbstractScriptLanguage {
129150
You can’t perform that action at this time.
0 commit comments