Mercurial > hg > truffle
changeset 22422:30644770899d
Testing identity behavior for String values
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Mon, 30 Nov 2015 15:13:33 +0100 |
parents | 71c7a1ae8829 |
children | 70a10a9f28ad |
files | truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java |
diffstat | 1 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java Sat Nov 28 00:42:25 2015 +0100 +++ b/truffle/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleTCK.java Mon Nov 30 15:13:33 2015 +0100 @@ -562,6 +562,20 @@ } @Test + public void testPrimitiveidentityString() throws Exception { + String id = identity(); + if (id == null) { + return; + } + PolyglotEngine.Value apply = findGlobalSymbol(id); + + String value = "Value" + RANDOM.nextInt(1000) + RANDOM.nextDouble(); + + String ret = (String) apply.invoke(null, value).get(); + assertEquals("The same value returned", value, ret); + } + + @Test public void testPrimitiveIdentityForeignObject() throws Exception { String id = identity(); if (id == null) {