branch: externals/parser-generator commit 6d2e2314c831c03954ea3f723c48906240b1d138 Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
Added two more failing valid LR-set calculation tests --- test/parser-test.el | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/test/parser-test.el b/test/parser-test.el index 44e31ca..1bd5588 100644 --- a/test/parser-test.el +++ b/test/parser-test.el @@ -230,13 +230,35 @@ ;; Example 5.29 p 387 (parser--set-grammar '((Sp S) (a b) ((Sp S) (S (S a S b)) (S e)) Sp)) (parser--set-look-ahead-number 1) - (message "Loaded grammar") + (should (equal '((Sp (S) nil (e)) (S (S) (a S b) (e)) (S (S) (a S b) (a))) (parser--lr-items 'S))) + (message "Passed V(S)") + + (should + (equal + '((S (S a) (S b) (e)) + (S (S a) (S b) (a)) + (S nil (S a S b) (a)) + (S nil (S a S b) (b)) + (S nil nil (a)) + (S nil nil (b))) + (parser--lr-items '(S a)))) + (message "Passed V(Sa)") + + (should + (equal + '((Sp nil (S) (e)) + (S nil (S a S b) (e)) + (S nil (S a S b) (a)) + (S nil nil (e)) + (S nil nil (a))) + (parser--lr-items 'e))) + (message "Passed V(e)") (message "Passed tests for (parser--lr-items)"))