From ae1b4910422b0242db10225bcc9fc94d7db0e095 Mon Sep 17 00:00:00 2001 From: Leo Viezens Date: Fri, 21 Oct 2022 09:41:36 +0200 Subject: [PATCH] Update xdry-php-plugin --- Makefile | 6 ++- _testdata/expected_xdry_report.json | 84 ++++++++++++++--------------- _testdata/xdry_2.json | 4 +- 3 files changed, 49 insertions(+), 45 deletions(-) diff --git a/Makefile b/Makefile index d3512a2..188fe0a 100644 --- a/Makefile +++ b/Makefile @@ -21,4 +21,8 @@ ifndef version endif @echo "Building for all platforms (version ${version})" chmod +x ./multiplatform_build.sh - ./multiplatform_build.sh ${version} \ No newline at end of file + ./multiplatform_build.sh ${version} + +.PHONY: test +test: + go test -v ./src... \ No newline at end of file diff --git a/_testdata/expected_xdry_report.json b/_testdata/expected_xdry_report.json index 2e46f54..89d73bb 100644 --- a/_testdata/expected_xdry_report.json +++ b/_testdata/expected_xdry_report.json @@ -192,7 +192,7 @@ "CloneType": 2, "AggregatedClones": [ { - "Content": "$x = 1 ; print ( $x ) ;", + "Content": "$x = 1 ; print $x ;", "Language": "php", "Instances": [ { @@ -218,44 +218,44 @@ ] }, { - "Content": "const x = 1 ; \n x . x ( x ) ; \n", - "Language": "javascript", + "Content": "$x = 1 ; $x = 1 ; print $x ;", + "Language": "php", "Instances": [ { - "Path": "%PROJECT_PATH%/_testdata/javascript/bar.js", - "Language": "javascript", - "Index": 16 + "Path": "%PROJECT_PATH%/_testdata/php/bar.php", + "Language": "php", + "Index": 0 }, { - "Path": "%PROJECT_PATH%/_testdata/javascript/bla.js", - "Language": "javascript", + "Path": "%PROJECT_PATH%/_testdata/php/bum.php", + "Language": "php", "Index": 0 }, { - "Path": "%PROJECT_PATH%/_testdata/javascript/foo.js", - "Language": "javascript", - "Index": 16 + "Path": "%PROJECT_PATH%/_testdata/php/foo.php", + "Language": "php", + "Index": 0 } ] }, { - "Content": "$x = 1 ; $x = 1 ; print ( $x ) ;", - "Language": "php", + "Content": "const x = 1 ; \n x . x ( x ) ; \n", + "Language": "javascript", "Instances": [ { - "Path": "%PROJECT_PATH%/_testdata/php/bar.php", - "Language": "php", - "Index": 0 + "Path": "%PROJECT_PATH%/_testdata/javascript/bar.js", + "Language": "javascript", + "Index": 16 }, { - "Path": "%PROJECT_PATH%/_testdata/php/bum.php", - "Language": "php", + "Path": "%PROJECT_PATH%/_testdata/javascript/bla.js", + "Language": "javascript", "Index": 0 }, { - "Path": "%PROJECT_PATH%/_testdata/php/foo.php", - "Language": "php", - "Index": 0 + "Path": "%PROJECT_PATH%/_testdata/javascript/foo.js", + "Language": "javascript", + "Index": 16 } ] }, @@ -281,7 +281,7 @@ "CloneType": 3, "AggregatedClones": [ { - "Content": "$x = 1 ; print ( $x ) ;", + "Content": "$x = 1 ; print $x ;", "Language": "php", "Instances": [ { @@ -307,44 +307,44 @@ ] }, { - "Content": "const x = 1 ; \n x . x ( x ) ; \n", - "Language": "javascript", + "Content": "$x = 1 ; $x = 1 ; print $x ;", + "Language": "php", "Instances": [ { - "Path": "%PROJECT_PATH%/_testdata/javascript/bar.js", - "Language": "javascript", - "Index": 16 + "Path": "%PROJECT_PATH%/_testdata/php/bar.php", + "Language": "php", + "Index": 0 }, { - "Path": "%PROJECT_PATH%/_testdata/javascript/bla.js", - "Language": "javascript", + "Path": "%PROJECT_PATH%/_testdata/php/bum.php", + "Language": "php", "Index": 0 }, { - "Path": "%PROJECT_PATH%/_testdata/javascript/foo.js", - "Language": "javascript", - "Index": 16 + "Path": "%PROJECT_PATH%/_testdata/php/foo.php", + "Language": "php", + "Index": 0 } ] }, { - "Content": "$x = 1 ; $x = 1 ; print ( $x ) ;", - "Language": "php", + "Content": "const x = 1 ; \n x . x ( x ) ; \n", + "Language": "javascript", "Instances": [ { - "Path": "%PROJECT_PATH%/_testdata/php/bar.php", - "Language": "php", - "Index": 0 + "Path": "%PROJECT_PATH%/_testdata/javascript/bar.js", + "Language": "javascript", + "Index": 16 }, { - "Path": "%PROJECT_PATH%/_testdata/php/bum.php", - "Language": "php", + "Path": "%PROJECT_PATH%/_testdata/javascript/bla.js", + "Language": "javascript", "Index": 0 }, { - "Path": "%PROJECT_PATH%/_testdata/php/foo.php", - "Language": "php", - "Index": 0 + "Path": "%PROJECT_PATH%/_testdata/javascript/foo.js", + "Language": "javascript", + "Index": 16 } ] }, diff --git a/_testdata/xdry_2.json b/_testdata/xdry_2.json index 704a2fd..641521d 100644 --- a/_testdata/xdry_2.json +++ b/_testdata/xdry_2.json @@ -32,7 +32,7 @@ "--rm", "-v", "%FILEPATH%:/file.php", - "leovie/xdry-php-plugin:0.1.0", + "leovie/xdry-php-plugin:0.2.1", "normalize:level-1", "/file.php" ] @@ -47,7 +47,7 @@ "--rm", "-v", "%FILEPATH%:/file.php", - "leovie/xdry-php-plugin:0.1.0", + "leovie/xdry-php-plugin:0.2.1", "normalize:level-2", "/file.php" ]