From c3f04453596533d58800d39df185d9b50608ba9a Mon Sep 17 00:00:00 2001 From: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> Date: Wed, 29 Jan 2025 14:18:50 -0500 Subject: [PATCH] Update metacall.rb --- metacall.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/metacall.rb b/metacall.rb index 8acc16f..c46d85b 100644 --- a/metacall.rb +++ b/metacall.rb @@ -192,6 +192,10 @@ def install (testpath/"test.js").write <<~EOS console.log("Hello from NodeJS") EOS + (testpath/"test-port.js").write <<~EOS + require('metacall'); + console.log("NodeJS Port"); + EOS Dir.mkdir(testpath/"typescript") (testpath/"typescript/typedfunc.ts").write <<~EOS 'use strict'; @@ -223,6 +227,9 @@ def install (testpath/"test.py").write <<~EOS print("Hello from Python") EOS + (testpath/"test-port.py").write <<~EOS + print("Python Port") + EOS (testpath/"test.rb").write <<~EOS print("Hello from Ruby") EOS @@ -239,6 +246,8 @@ def install assert_match "Hello from Ruby", shell_output("#{bin}/metacall test.rb") assert_match "Hello from NodeJS", shell_output("#{bin}/metacall test.js") assert_match "54321", shell_output(testpath/"test_typescript.sh") + assert_match "NodeJS Port", shell_output("#{bin}/metacall test-port.js") + assert_match "Python Port", shell_output("#{bin}/metacall test-port.py") # TODO: Enable Java # assert_match "Hello from Java", shell_output("#{bin}/metacall test.java")