From 7854140569f9361bc8510832be7b0ae9089ec513 Mon Sep 17 00:00:00 2001 From: "t.t" <7117978+ttodua@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:29:33 +0400 Subject: [PATCH 1/5] fix(php) - bug --- tests/phpTranspiler.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpTranspiler.test.ts b/tests/phpTranspiler.test.ts index e140591..4248fa3 100644 --- a/tests/phpTranspiler.test.ts +++ b/tests/phpTranspiler.test.ts @@ -842,7 +842,7 @@ describe('php transpiling tests', () => { const output = transpiler.transpilePhp(ts).content; expect(output).toBe(php); }); - test.only('transpile constants & imports', () => { + test('transpile constants & imports', () => { const ts = "import { decimalToPrecision, ROUND, TRUNCATE, DECIMAL_PLACES, } from '../../somewhere.js';\n" + "const exc = new xyz ();\n" + "assert (exc.decimalToPrecision ('12.3456000', TRUNCATE, 100, DECIMAL_PLACES) === '12.3456');"; From f09aec291a5beeec86da5dc7b97a78c6907f1488 Mon Sep 17 00:00:00 2001 From: "t.t" <7117978+ttodua@users.noreply.github.com> Date: Wed, 6 Nov 2024 21:55:43 +0400 Subject: [PATCH 2/5] whatever tests --- tests/csharpTranspiler.test.ts | 10 ++++++---- tests/phpTranspiler.test.ts | 10 ++++++---- tests/pythonTranspiler.test.ts | 10 ++++++---- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/tests/csharpTranspiler.test.ts b/tests/csharpTranspiler.test.ts index 2e0b819..71884ea 100644 --- a/tests/csharpTranspiler.test.ts +++ b/tests/csharpTranspiler.test.ts @@ -81,8 +81,9 @@ describe('csharp transpiling tests', () => { " public x: number = 10;\n" + " public y: string = \"test\";\n" + " public z1: string[] = [ 'a', 'b' ];\n" + - " public z2: any = whatever;\n" + - " public z3: any = {};\n" + + " public z2: any = Whatever;\n" + + " public z3: any = whatever;\n" + + " public z4: any = {};\n" + " mainFeature(message): void {\n" + " console.log(\"Hello! I'm inside main class:\" + message)\n" + " }\n" + @@ -93,8 +94,9 @@ describe('csharp transpiling tests', () => { " public object x = 10;\n" + " public string y = \"test\";\n" + " public List z1 = new List() {\"a\", \"b\"};\n" + - " public Dictionary z2 = whatever;\n" + - " public Dictionary z3 = new Dictionary() {};\n" + + " public Dictionary z2 = Whatever;\n" + + " public Dictionary z3 = whatever;\n" + + " public Dictionary z4 = new Dictionary() {};\n" + "\n" + " public virtual void mainFeature(object message)\n" + " {\n" + diff --git a/tests/phpTranspiler.test.ts b/tests/phpTranspiler.test.ts index 4248fa3..10dad25 100644 --- a/tests/phpTranspiler.test.ts +++ b/tests/phpTranspiler.test.ts @@ -301,8 +301,9 @@ describe('php transpiling tests', () => { " public static x: number = 10;\n" + " public static y: string = \"test\";\n" + " public static a1: string[] = [ 'a', 'b' ];\n" + - " public static a2: any = whatever;\n" + - " public static a3: any = {};\n" + + " public static a2: any = Whatever;\n" + + " public static a3: any = whatever;\n" + + " public static a4: any = {};\n" + " mainFeature(message) {\n" + " console.log(\"Hello! I'm inside main class:\" + message)\n" + " }\n" + @@ -312,8 +313,9 @@ describe('php transpiling tests', () => { " public static $x = 10;\n" + " public static $y = 'test';\n" + " public static $a1 = ['a', 'b'];\n" + - " public static $a2 = whatever;\n" + - " public static $a3 = array();\n" + + " public static $a2 = Whatever;\n" + + " public static $a3 = $whatever;\n" + + " public static $a4 = array();\n" + "\n" + " public function mainFeature($message) {\n" + " var_dump('Hello! I\\'m inside main class:' . $message);\n" + diff --git a/tests/pythonTranspiler.test.ts b/tests/pythonTranspiler.test.ts index 8a4b44f..75e5cba 100644 --- a/tests/pythonTranspiler.test.ts +++ b/tests/pythonTranspiler.test.ts @@ -250,8 +250,9 @@ describe('python tests', () => { " public static x: number = 10;\n" + " public static y: string = \"test\";\n" + " public static a1: string[] = [ 'a', 'b' ];\n" + - " public static a2: any = whatever;\n" + - " public static a3: any = {};\n" + + " public static a2: any = Whatever;\n" + + " public static a3: any = whatever;\n" + + " public static a4: any = {};\n" + " mainFeature(message) {\n" + " console.log(\"Hello! I'm inside main class:\" + message)\n" + " }\n" + @@ -261,8 +262,9 @@ describe('python tests', () => { " x = 10\n" + " y = 'test'\n" + " a1 = ['a', 'b']\n" + - " a2 = whatever\n" + - " a3 = {}\n" + + " a2 = Whatever\n" + + " a3 = whatever\n" + + " a4 = {}\n" + "\n" + " def mainFeature(self, message):\n" + " print('Hello! I\\'m inside main class:' + message)" From 217d9cad6030b2bb995a2cb78181eaf51fb4fcd2 Mon Sep 17 00:00:00 2001 From: "t.t" <7117978+ttodua@users.noreply.github.com> Date: Wed, 6 Nov 2024 21:58:29 +0400 Subject: [PATCH 3/5] cases --- tests/csharpTranspiler.test.ts | 12 ++++++------ tests/phpTranspiler.test.ts | 12 ++++++------ tests/pythonTranspiler.test.ts | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/csharpTranspiler.test.ts b/tests/csharpTranspiler.test.ts index 71884ea..88681cb 100644 --- a/tests/csharpTranspiler.test.ts +++ b/tests/csharpTranspiler.test.ts @@ -81,9 +81,9 @@ describe('csharp transpiling tests', () => { " public x: number = 10;\n" + " public y: string = \"test\";\n" + " public z1: string[] = [ 'a', 'b' ];\n" + - " public z2: any = Whatever;\n" + - " public z3: any = whatever;\n" + - " public z4: any = {};\n" + + " public z2: any = whatever;\n" + + " public z3: any = {};\n" + + " public z4: any = Whatever;\n" + " mainFeature(message): void {\n" + " console.log(\"Hello! I'm inside main class:\" + message)\n" + " }\n" + @@ -94,9 +94,9 @@ describe('csharp transpiling tests', () => { " public object x = 10;\n" + " public string y = \"test\";\n" + " public List z1 = new List() {\"a\", \"b\"};\n" + - " public Dictionary z2 = Whatever;\n" + - " public Dictionary z3 = whatever;\n" + - " public Dictionary z4 = new Dictionary() {};\n" + + " public Dictionary z2 = whatever;\n" + + " public Dictionary z3 = new Dictionary() {};\n" + + " public Dictionary z4 = Whatever;\n" + "\n" + " public virtual void mainFeature(object message)\n" + " {\n" + diff --git a/tests/phpTranspiler.test.ts b/tests/phpTranspiler.test.ts index 10dad25..b039c91 100644 --- a/tests/phpTranspiler.test.ts +++ b/tests/phpTranspiler.test.ts @@ -301,9 +301,9 @@ describe('php transpiling tests', () => { " public static x: number = 10;\n" + " public static y: string = \"test\";\n" + " public static a1: string[] = [ 'a', 'b' ];\n" + - " public static a2: any = Whatever;\n" + - " public static a3: any = whatever;\n" + - " public static a4: any = {};\n" + + " public static a2: any = whatever;\n" + + " public static a3: any = {};\n" + + " public static a4: any = Whatever;\n" + " mainFeature(message) {\n" + " console.log(\"Hello! I'm inside main class:\" + message)\n" + " }\n" + @@ -313,9 +313,9 @@ describe('php transpiling tests', () => { " public static $x = 10;\n" + " public static $y = 'test';\n" + " public static $a1 = ['a', 'b'];\n" + - " public static $a2 = Whatever;\n" + - " public static $a3 = $whatever;\n" + - " public static $a4 = array();\n" + + " public static $a1 = $whatever;\n" + + " public static $a2 = array();\n" + + " public static $a3 = Whatever;\n" + "\n" + " public function mainFeature($message) {\n" + " var_dump('Hello! I\\'m inside main class:' . $message);\n" + diff --git a/tests/pythonTranspiler.test.ts b/tests/pythonTranspiler.test.ts index 75e5cba..bbcd5e1 100644 --- a/tests/pythonTranspiler.test.ts +++ b/tests/pythonTranspiler.test.ts @@ -250,9 +250,9 @@ describe('python tests', () => { " public static x: number = 10;\n" + " public static y: string = \"test\";\n" + " public static a1: string[] = [ 'a', 'b' ];\n" + - " public static a2: any = Whatever;\n" + - " public static a3: any = whatever;\n" + - " public static a4: any = {};\n" + + " public static a2: any = whatever;\n" + + " public static a3: any = {};\n" + + " public static a4: any = Whatever;\n" + " mainFeature(message) {\n" + " console.log(\"Hello! I'm inside main class:\" + message)\n" + " }\n" + @@ -262,9 +262,9 @@ describe('python tests', () => { " x = 10\n" + " y = 'test'\n" + " a1 = ['a', 'b']\n" + - " a2 = Whatever\n" + - " a3 = whatever\n" + - " a4 = {}\n" + + " a2 = whatever\n" + + " a3 = {}\n" + + " a4 = Whatever\n" + "\n" + " def mainFeature(self, message):\n" + " print('Hello! I\\'m inside main class:' + message)" From 1f2c5086f514aa772ecf4d387877d4095d57a9f6 Mon Sep 17 00:00:00 2001 From: "t.t" <7117978+ttodua@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:03:02 +0400 Subject: [PATCH 4/5] name fix --- tests/phpTranspiler.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/phpTranspiler.test.ts b/tests/phpTranspiler.test.ts index b039c91..4503c30 100644 --- a/tests/phpTranspiler.test.ts +++ b/tests/phpTranspiler.test.ts @@ -313,9 +313,9 @@ describe('php transpiling tests', () => { " public static $x = 10;\n" + " public static $y = 'test';\n" + " public static $a1 = ['a', 'b'];\n" + - " public static $a1 = $whatever;\n" + - " public static $a2 = array();\n" + - " public static $a3 = Whatever;\n" + + " public static $a2 = $whatever;\n" + + " public static $a3 = array();\n" + + " public static $a4 = Whatever;\n" + "\n" + " public function mainFeature($message) {\n" + " var_dump('Hello! I\\'m inside main class:' . $message);\n" + From e12ff7f500b743e2df973218ee61823049629c53 Mon Sep 17 00:00:00 2001 From: "t.t" <7117978+ttodua@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:08:20 +0400 Subject: [PATCH 5/5] space --- tests/csharpTranspiler.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/csharpTranspiler.test.ts b/tests/csharpTranspiler.test.ts index 88681cb..4857312 100644 --- a/tests/csharpTranspiler.test.ts +++ b/tests/csharpTranspiler.test.ts @@ -94,9 +94,9 @@ describe('csharp transpiling tests', () => { " public object x = 10;\n" + " public string y = \"test\";\n" + " public List z1 = new List() {\"a\", \"b\"};\n" + - " public Dictionary z2 = whatever;\n" + + " public Dictionary z2 = whatever;\n" + " public Dictionary z3 = new Dictionary() {};\n" + - " public Dictionary z4 = Whatever;\n" + + " public Dictionary z4 = Whatever;\n" + "\n" + " public virtual void mainFeature(object message)\n" + " {\n" +