Victor Vasiliev has uploaded a new change for review. https://gerrit.wikimedia.org/r/305937
Change subject: Add test coverage for more bizzare features of the filter parser ...................................................................... Add test coverage for more bizzare features of the filter parser I am pretty sure all of the behavior documented in these tests is a bad idea. It is possible that we can fix it since some of those features are probably unused, but for now those tests will serve as a documentation of the current behavior. Change-Id: Ia2a2f57a538d7aef2ac73fb2e47fe82dd5d5e09a --- A tests/parserTests/expn.r A tests/parserTests/expn.t A tests/parserTests/list-assignment.r A tests/parserTests/list-assignment.t A tests/parserTests/list-inequality.r A tests/parserTests/list-inequality.t 6 files changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/AbuseFilter refs/changes/37/305937/1 diff --git a/tests/parserTests/expn.r b/tests/parserTests/expn.r new file mode 100644 index 0000000..4736e08 --- /dev/null +++ b/tests/parserTests/expn.r @@ -0,0 +1 @@ +MATCH diff --git a/tests/parserTests/expn.t b/tests/parserTests/expn.t new file mode 100644 index 0000000..bd39c38 --- /dev/null +++ b/tests/parserTests/expn.t @@ -0,0 +1,2 @@ +/* In filter language, the exponentiation is left-associative */ +(2 ** 3 ** 2) == 64 diff --git a/tests/parserTests/list-assignment.r b/tests/parserTests/list-assignment.r new file mode 100644 index 0000000..4736e08 --- /dev/null +++ b/tests/parserTests/list-assignment.r @@ -0,0 +1 @@ +MATCH diff --git a/tests/parserTests/list-assignment.t b/tests/parserTests/list-assignment.t new file mode 100644 index 0000000..c055541 --- /dev/null +++ b/tests/parserTests/list-assignment.t @@ -0,0 +1,6 @@ +test_list := [ [1, 2], [3, 4] ]; + +test_list[1] := 42; +test_list[] := 17; + +test_list[0][0] == 1 & test_list[0][1] == 2 & test_list[1] == 42 & test_list[2] == 17 diff --git a/tests/parserTests/list-inequality.r b/tests/parserTests/list-inequality.r new file mode 100644 index 0000000..4736e08 --- /dev/null +++ b/tests/parserTests/list-inequality.r @@ -0,0 +1 @@ +MATCH diff --git a/tests/parserTests/list-inequality.t b/tests/parserTests/list-inequality.t new file mode 100644 index 0000000..6ffed4f --- /dev/null +++ b/tests/parserTests/list-inequality.t @@ -0,0 +1,3 @@ +a := [1, 2, 3]; + +a != a -- To view, visit https://gerrit.wikimedia.org/r/305937 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia2a2f57a538d7aef2ac73fb2e47fe82dd5d5e09a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/AbuseFilter Gerrit-Branch: master Gerrit-Owner: Victor Vasiliev <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
