Mercurial > hg > truffle
diff truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/vm/TruffleVMSingleThreadedTest.java @ 22104:cf19259edf87
TruffleVM.eval and Source.withMimeType
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Mon, 24 Aug 2015 08:46:21 +0200 |
parents | 9c8c0937da41 |
children | dc83cc1f94f2 ffadd23c63c8 |
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/vm/TruffleVMSingleThreadedTest.java Mon Aug 24 08:25:31 2015 +0200 +++ b/truffle/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/vm/TruffleVMSingleThreadedTest.java Mon Aug 24 08:46:21 2015 +0200 @@ -22,6 +22,7 @@ */ package com.oracle.truffle.api.test.vm; +import com.oracle.truffle.api.source.Source; import java.io.*; import java.net.*; @@ -45,16 +46,19 @@ t.join(); } + @SuppressWarnings("deprecation") @Test(expected = IllegalStateException.class) public void evalURI() throws IOException, URISyntaxException { tvm.eval(new URI("http://unknown.js")); } + @SuppressWarnings("deprecation") @Test(expected = IllegalStateException.class) public void evalString() throws IOException { tvm.eval("text/javascript", "1 + 1"); } + @SuppressWarnings("deprecation") @Test(expected = IllegalStateException.class) public void evalReader() throws IOException { try (StringReader sr = new StringReader("1 + 1")) { @@ -63,6 +67,11 @@ } @Test(expected = IllegalStateException.class) + public void evalSource() throws IOException { + tvm.eval(Source.fromText("", "Empty")); + } + + @Test(expected = IllegalStateException.class) public void findGlobalSymbol() { tvm.findGlobalSymbol("doesNotExists"); }