1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package eu.simuline.octave.io;
20
21 import eu.simuline.octave.OctaveEngine;
22 import eu.simuline.octave.OctaveEngineFactory;
23 import eu.simuline.octave.type.Octave;
24 import eu.simuline.octave.type.OctaveDouble;
25
26 import static org.junit.Assert.assertNull;
27 import static org.junit.Assert.assertEquals;
28
29 import org.junit.Ignore;
30 import org.junit.Test;
31
32
33 public class TestUnknownVar {
34
35
36
37
38 @Test public void testGetUnknownVar() {
39 final OctaveEngine octave = new OctaveEngineFactory().getScriptEngine();
40 final OctaveDouble x1 = octave.get(OctaveDouble.class, "x");
41 assertNull(x1);
42 final OctaveDouble x = Octave.scalar(42);
43 octave.put("x", x);
44 final OctaveDouble x2 = octave.get(OctaveDouble.class, "x");
45 assertEquals(x, x2);
46 octave.close();
47 }
48
49 }