diff truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.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 f54d7e045a37
children d045a505c2b3
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java	Mon Aug 24 08:25:31 2015 +0200
+++ b/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java	Mon Aug 24 08:46:21 2015 +0200
@@ -24,6 +24,7 @@
  */
 package com.oracle.truffle.tck;
 
+import com.oracle.truffle.api.source.Source;
 import com.oracle.truffle.api.vm.TruffleVM;
 import java.io.IOException;
 import java.util.Random;
@@ -44,8 +45,8 @@
     /**
      * This methods is called before first test is executed. It's purpose is to set a TruffleVM with
      * your language up, so it is ready for testing.
-     * {@link TruffleVM#eval(java.lang.String, java.lang.String) Execute} any scripts you need, and
-     * prepare global symbols with proper names. The symbols will then be looked up by the
+     * {@link TruffleVM#eval(com.oracle.truffle.api.source.Source) Execute} any scripts you need,
+     * and prepare global symbols with proper names. The symbols will then be looked up by the
      * infrastructure (using the names provided by you from methods like {@link #plusInt()}) and
      * used for internal testing.
      *
@@ -56,8 +57,8 @@
 
     /**
      * Mimetype associated with your language. The mimetype will be passed to
-     * {@link TruffleVM#eval(java.lang.String, java.lang.String)} method of the {@link #prepareVM()
-     * created TruffleVM}.
+     * {@link TruffleVM#eval(com.oracle.truffle.api.source.Source)} method of the
+     * {@link #prepareVM() created TruffleVM}.
      *
      * @return mime type of the tested language
      */
@@ -116,7 +117,7 @@
 
     /**
      * Return a code snippet that is invalid in your language. Its
-     * {@link TruffleVM#eval(java.lang.String, java.lang.String) evaluation} should fail and yield
+     * {@link TruffleVM#eval(com.oracle.truffle.api.source.Source) evaluation} should fail and yield
      * an exception.
      *
      * @return code snippet invalid in the tested language
@@ -180,7 +181,7 @@
     public void testInvalidTestMethod() throws Exception {
         String mime = mimeType();
         String code = invalidCode();
-        Object ret = vm().eval(mime, code);
+        Object ret = vm().eval(Source.fromText(code, "Invalid code").withMimeType(mime));
         fail("Should yield IOException, but returned " + ret);
     }