ctx.setLanguageVersion(170);
final Global global = new Global();
global.initStandardObjects(ctx,false);
NativeObject exports = new NativeObject();
global.put("exports", global, exports);
global.put("__dirname", global, "/a/b/c/");
System.setProperty("user.dir", "/a/b/c/");
InputStream resourceAsStream = Rhinodo.class.getClassLoader().getResourceAsStream("META-INF/env/path.js");
ctx.evaluateReader(global,new InputStreamReader(resourceAsStream), "path",-1, null);
Function function = (Function) exports.get("resolve");
Object result = (Object) function.call(ctx, global, exports, new Object[]{"../hello"});
assertEquals("/a/b/hello", Context.toString(result));
result = (Object) function.call(ctx, global, exports, new Object[]{"./bye"});
assertEquals("/a/b/c/bye", Context.toString(result));