diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 12:08:18 +0000 |
commit | 5da14042f70711ea5cf66e034699730335462f66 (patch) | |
tree | 0f6354ccac934ed87a2d555f45be4c831cf92f4a /web/server/h2o/libh2o/misc/oktavia/test/test-query-string-parser.jsx | |
parent | Releasing debian version 1.44.3-2. (diff) | |
download | netdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz netdata-5da14042f70711ea5cf66e034699730335462f66.zip |
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/server/h2o/libh2o/misc/oktavia/test/test-query-string-parser.jsx')
-rw-r--r-- | web/server/h2o/libh2o/misc/oktavia/test/test-query-string-parser.jsx | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/web/server/h2o/libh2o/misc/oktavia/test/test-query-string-parser.jsx b/web/server/h2o/libh2o/misc/oktavia/test/test-query-string-parser.jsx deleted file mode 100644 index 94ec7c193..000000000 --- a/web/server/h2o/libh2o/misc/oktavia/test/test-query-string-parser.jsx +++ /dev/null @@ -1,94 +0,0 @@ -import "test-case.jsx"; -import "query-string-parser.jsx"; - -class _Test extends TestCase -{ - var parser : QueryStringParser; - - override function setUp () : void - { - this.parser = new QueryStringParser(); - } - - function test_single_string_and () : void - { - this.parser.parse('word1 word2'); - this.expect(this.parser.queries.length).toBe(2); - - this.expect(this.parser.queries[0].word).toBe('word1'); - this.expect(this.parser.queries[0].or).toBe(false); - this.expect(this.parser.queries[0].not).toBe(false); - this.expect(this.parser.queries[0].raw).toBe(false); - - this.expect(this.parser.queries[1].word).toBe('word2'); - this.expect(this.parser.queries[1].or).toBe(false); - this.expect(this.parser.queries[1].not).toBe(false); - this.expect(this.parser.queries[1].raw).toBe(false); - } - - function test_single_string_or () : void - { - this.parser.parse('word1 OR word2'); - this.expect(this.parser.queries.length).toBe(2); - - this.expect(this.parser.queries[0].word).toBe('word1'); - this.expect(this.parser.queries[0].or).toBe(false); - this.expect(this.parser.queries[0].not).toBe(false); - this.expect(this.parser.queries[0].raw).toBe(false); - - this.expect(this.parser.queries[1].word).toBe('word2'); - this.expect(this.parser.queries[1].or).toBe(true); - this.expect(this.parser.queries[1].not).toBe(false); - this.expect(this.parser.queries[1].raw).toBe(false); - } - - function test_single_string_not () : void - { - this.parser.parse('word1 -word2'); - this.expect(this.parser.queries.length).toBe(2); - - this.expect(this.parser.queries[0].word).toBe('word1'); - this.expect(this.parser.queries[0].or).toBe(false); - this.expect(this.parser.queries[0].not).toBe(false); - this.expect(this.parser.queries[0].raw).toBe(false); - - this.expect(this.parser.queries[1].word).toBe('word2'); - this.expect(this.parser.queries[1].or).toBe(false); - this.expect(this.parser.queries[1].not).toBe(true); - this.expect(this.parser.queries[1].raw).toBe(false); - } - - function test_single_string_raw () : void - { - this.parser.parse('word1 "word2"'); - this.expect(this.parser.queries.length).toBe(2); - - this.expect(this.parser.queries[0].word).toBe('word1'); - this.expect(this.parser.queries[0].or).toBe(false); - this.expect(this.parser.queries[0].not).toBe(false); - this.expect(this.parser.queries[0].raw).toBe(false); - - this.expect(this.parser.queries[1].word).toBe('word2'); - this.expect(this.parser.queries[1].or).toBe(false); - this.expect(this.parser.queries[1].not).toBe(false); - this.expect(this.parser.queries[1].raw).toBe(true); - } - - function test_single_string_raw_not () : void - { - this.parser.parse('word1 -"word2"'); - this.expect(this.parser.queries.length).toBe(2); - - this.expect(this.parser.queries[0].word).toBe('word1'); - this.expect(this.parser.queries[0].or).toBe(false); - this.expect(this.parser.queries[0].not).toBe(false); - this.expect(this.parser.queries[0].raw).toBe(false); - - this.expect(this.parser.queries[1].word).toBe('word2'); - this.expect(this.parser.queries[1].or).toBe(false); - this.expect(this.parser.queries[1].not).toBe(true); - this.expect(this.parser.queries[1].raw).toBe(true); - } - -} - |