• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

peczenyj / lua-gdpr-iab-tcfv2 / 25669983764
91%

Build:
DEFAULT BRANCH: devel
Ran 11 May 2026 12:26PM UTC
Jobs 7
Files 11
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 May 2026 12:25PM UTC coverage: 88.551% (+0.6%) from 87.992%
25669983764

push

github

web-flow
fix(robustness): nil-safe predicates, no override mutation, router warnings (#18)

Five small reliability fixes surfaced by the post-v0.1.0 review.
Aggregating them in one PR because they share the same lenient-mode
theme (don't crash, don't surprise, surface the issue via warnings)
and three of them touch interfaces between parser/router/validator.

* parser.lua: is_v22_plus and is_v23 returned `nil >= 4` and crashed
  when the core segment was truncated enough that policyVersion never
  decoded. Now check pv ~= nil first and return false. The predicates
  are documented booleans; nil was never a valid return.
* parser.lua: in strict mode, reject TC strings with empty segments
  (leading dot, trailing dot, or consecutive dots) before splitting.
  Lenient mode keeps the current silent-drop behavior via gmatch.
* parser.lua: pass core.warnings to Router.decode_segments so router
  failures in lenient mode land on the unified parser.warnings aggregate
  instead of being silently swallowed.
* validator.lua: Validator:validate was calling
  setmetatable(overrides, { __index = self.config }) which mutates the
  caller's table by attaching a metatable. Replace with a copy so the
  override table the caller passed in is byte-for-byte unchanged after
  the call.
* validator.lua: min_tcf_policy_version check would crash with
  "attempt to compare nil with number" if policyVersion was nil. Now
  treats nil as failing the floor (fail-closed -- we can't verify the
  requirement). Existing test's %d+ pattern still matches the happy
  path; the nil branch is new and covered by a new test.
* router.lua: lenient-mode segment failures (invalid base64, unknown
  type, decoder rejection) are now appended to the passed-in warnings
  table instead of silently dropped. Matches the AGENTS.md contract
  for lenient mode.

Tests:
* router_spec.lua: deleted the empty "Type 1 - Mock" placeholder test
  (body was only comments, asserted nothing). Replaced with real
  coverage of... (continued)

31 of 45 new or added lines in 3 files covered. (68.89%)

495 of 559 relevant lines covered (88.55%)

58762.54 hits per line

Uncovered Changes

Lines Coverage ∆ File
14
68.89
-9.24% src/gdpr/iab/tcfv2/router.lua
Jobs
ID Job ID Ran Files Coverage
1 25669983764.1 11 May 2026 12:26PM UTC 11
88.19
GitHub Action Run
2 25669983764.2 11 May 2026 12:26PM UTC 11
88.55
GitHub Action Run
3 25669983764.3 11 May 2026 12:26PM UTC 11
88.55
GitHub Action Run
4 25669983764.4 11 May 2026 12:26PM UTC 11
88.19
GitHub Action Run
5 25669983764.5 11 May 2026 12:26PM UTC 11
88.55
GitHub Action Run
6 25669983764.6 11 May 2026 12:26PM UTC 11
88.55
GitHub Action Run
7 25669983764.7 11 May 2026 12:26PM UTC 11
88.55
GitHub Action Run
Source Files on build 25669983764
  • Tree
  • List 11
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8b204f05 on github
  • Prev Build on devel (#25668436572)
  • Next Build on devel (#25670557487)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc