Skip to content

Commit

Permalink
Merge pull request #19 from ttodua/dummy-bug
Browse files Browse the repository at this point in the history
fix(php) - bug
  • Loading branch information
carlosmiei authored Nov 18, 2024
2 parents d45d2b1 + e25358d commit ca2e546
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tests/csharpTranspiler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ describe('csharp transpiling tests', () => {
" public z1: string[] = [ 'a', 'b' ];\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" +
Expand All @@ -95,6 +96,7 @@ describe('csharp transpiling tests', () => {
" public List<object> z1 = new List<object>() {\"a\", \"b\"};\n" +
" public Dictionary<string, object> z2 = whatever;\n" +
" public Dictionary<string, object> z3 = new Dictionary<string, object>() {};\n" +
" public Dictionary<string, object> z4 = Whatever;\n" +
"\n" +
" public virtual void mainFeature(object message)\n" +
" {\n" +
Expand Down
6 changes: 4 additions & 2 deletions tests/phpTranspiler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ describe('php transpiling tests', () => {
" public static a1: string[] = [ 'a', 'b' ];\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" +
Expand All @@ -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 $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" +
Expand Down Expand Up @@ -842,7 +844,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');";
Expand Down
2 changes: 2 additions & 0 deletions tests/pythonTranspiler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ describe('python tests', () => {
" public static a1: string[] = [ 'a', 'b' ];\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" +
Expand All @@ -263,6 +264,7 @@ describe('python tests', () => {
" a1 = ['a', 'b']\n" +
" a2 = whatever\n" +
" a3 = {}\n" +
" a4 = Whatever\n" +
"\n" +
" def mainFeature(self, message):\n" +
" print('Hello! I\\'m inside main class:' + message)"
Expand Down

0 comments on commit ca2e546

Please sign in to comment.