From 289e382e63c0171f8ae75f6b547e7f21394f0d6c Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Mon, 25 Sep 2017 15:08:23 +0200 Subject: [PATCH] re-add module focused unicode test --- tests/unicode.phpt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/unicode.phpt b/tests/unicode.phpt index a11bbb9..58fd2f5 100644 --- a/tests/unicode.phpt +++ b/tests/unicode.phpt @@ -20,20 +20,31 @@ $jscript->unicode = $unicode; # insert unicode via executeString $jscript->executeString("var execStr = {unicode: '" . $unicode . "'}"); +# insert via module loader +$jscript->setModuleLoader(function ($path) use ($unicode) { + return "module.exports = {unicode: '" . $unicode . "'}"; +}); + + # return to php $jscript->executeString("values = {}"); $jscript->executeString("values['snapshot'] = snapshot.unicode"); $jscript->executeString("values['php'] = php.unicode"); $jscript->executeString("values['execStr'] = execStr.unicode"); +$jscript->executeString("values['module'] = require('module').unicode"); + $values = $jscript->executeString("values"); echo "snapshot: $values->snapshot\n"; echo "php : $values->php\n"; echo "execStr : $values->execStr\n"; +echo "module : $values->module\n"; + ?> ===EOF=== --EXPECT-- snapshot: äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃ php : äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃ execStr : äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃ +module : äöüßÜÄÖÜ߀áàâÁÀµ²³▁▂▃▄▅▆▇█    ㌀ ㌁ ㌂ ㌃ ===EOF===