From 811a9a914135de2ee09091b0cebf6eb53bcf92dd Mon Sep 17 00:00:00 2001 From: Hugo Thunnissen Date: Sun, 12 Sep 2021 18:41:11 +0200 Subject: [PATCH] Add more tests for the parser code --- test/fixtures/Array.el | 1 + test/fixtures/Array.php | 4 +++ test/fixtures/ShortFunction.el | 1 + test/fixtures/ShortFunction.php | 4 +++ test/fixtures/SmallNamespacedClass.el | 1 + test/fixtures/SmallNamespacedClass.php | 8 ++++++ test/fixtures/TwoShortFunctions.el | 1 + test/fixtures/TwoShortFunctions.php | 8 ++++++ test/fixtures/Variable.el | 1 + test/fixtures/Variable.php | 2 ++ test/fixtures/Word.el | 1 + test/fixtures/Word.php | 2 ++ test/phpinspect-test.el | 40 +++++++++++++++++++++++++- 13 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/Array.el create mode 100644 test/fixtures/Array.php create mode 100644 test/fixtures/ShortFunction.el create mode 100644 test/fixtures/ShortFunction.php create mode 100644 test/fixtures/SmallNamespacedClass.el create mode 100644 test/fixtures/SmallNamespacedClass.php create mode 100644 test/fixtures/TwoShortFunctions.el create mode 100644 test/fixtures/TwoShortFunctions.php create mode 100644 test/fixtures/Variable.el create mode 100644 test/fixtures/Variable.php create mode 100644 test/fixtures/Word.el create mode 100644 test/fixtures/Word.php diff --git a/test/fixtures/Array.el b/test/fixtures/Array.el new file mode 100644 index 0000000..80b28e2 --- /dev/null +++ b/test/fixtures/Array.el @@ -0,0 +1 @@ +(:root (:array (:string "item1") (:comma ",") (:string "item2") (:comma ",") (:string "item3")) (:terminator ";") (:array (:string "item1") (:fat-arrow "=>") (:string "item2") (:comma ",") (:string "item3") (:fat-arrow "=>") (:string "item4"))) diff --git a/test/fixtures/Array.php b/test/fixtures/Array.php new file mode 100644 index 0000000..a36c76d --- /dev/null +++ b/test/fixtures/Array.php @@ -0,0 +1,4 @@ + 'item2', + 'item3' => 'item4' ] diff --git a/test/fixtures/ShortFunction.el b/test/fixtures/ShortFunction.el new file mode 100644 index 0000000..48468fa --- /dev/null +++ b/test/fixtures/ShortFunction.el @@ -0,0 +1 @@ +(:root (:function (:declaration (:word "function") (:word "work") (:list)) (:block (:word "return") (:variable "variable") (:terminator ";")))) diff --git a/test/fixtures/ShortFunction.php b/test/fixtures/ShortFunction.php new file mode 100644 index 0000000..91295e9 --- /dev/null +++ b/test/fixtures/ShortFunction.php @@ -0,0 +1,4 @@ +