diff options
author | Aki <please@ignore.pl> | 2024-07-19 23:55:23 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-07-19 23:55:23 +0200 |
commit | 87c8a5e8955a57e6365adb4aa64575308b17c47d (patch) | |
tree | 96bac7ab83434cbd21dab9e58921e45c2cb7d830 /spec/parser_spec.lua | |
parent | d6189e60851ff347c8c11812025232621f54096e (diff) | |
download | headers-87c8a5e8955a57e6365adb4aa64575308b17c47d.zip headers-87c8a5e8955a57e6365adb4aa64575308b17c47d.tar.gz headers-87c8a5e8955a57e6365adb4aa64575308b17c47d.tar.bz2 |
Use multiset-like data structure for storing headers
This looks like an overkill because it is one. The space and time
complexity of the multiset structure is rather bad. At this point it
stays mostly because of sunk cost fallacy. It will provide OK
abstraction layer to build the rest of this forsaken project.
Diffstat (limited to 'spec/parser_spec.lua')
-rw-r--r-- | spec/parser_spec.lua | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/spec/parser_spec.lua b/spec/parser_spec.lua index 78ee8b8..53f86a1 100644 --- a/spec/parser_spec.lua +++ b/spec/parser_spec.lua @@ -1,16 +1,31 @@ -local parse = require "headers.parser" +local parser = require "headers.parser" describe("Scheme", function() + local headers + + setup(function() + headers = parser.new() + end) + it("version one is supported", function() assert.has_no.errors(function() - parse [[scheme "headers/1"]] + headers:parse [[scheme "headers/1"]] end) end) it("is not required", function() assert.has_no.errors(function() - parse "" + headers:parse "" end) end) end) + + +describe("Standards (tags)", function() -- TODO: Streamline the naming convention standards/tags/aliases? + local headers + + setup(function() + headers = parser.new() + end) +end) |