package com.axiastudio.zoefx.core.script;

import com.axiastudio.zoefx.core.Utilities;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 * User: tiziano
 * Date: 14/04/14
 * Time: 16:48
 */
public class JSScriptEngineImplTest {

    @BeforeClass
    public static void setUpClass() {
        JSEngineImpl engine = new JSEngineImpl();
        Utilities.registerUtility(engine, ScriptEngine.class);
    }

    @Test
    public void testEval() throws Exception {
        ScriptEngine engine = Utilities.queryUtility(ScriptEngine.class);
        String script = "function test(){ return \"ciao\"; } test()";
        Object eval = engine.eval(script);
        assert eval.toString().equals("ciao");
    }
}

@@ -565,25 +565,8 @@
  = %22
-function test()%7B 
 retu
@@ -581,17 +581,8 @@
 o%5C%22;
- %7D test()
 %22;%0A 

Fix in JS Engine test.