Skip to content

test(exclude-filter): pin substring and escaped provider-name behavior (#356) - #362

Draft
saymer-alt wants to merge 2 commits into
mainfrom
test/exclude-filter-substring-356
Draft

saymer-alt wants to merge 2 commits into
mainfrom
test/exclude-filter-substring-356

Conversation

@saymer-alt

Copy link
Copy Markdown
Owner

Scope — Issue #356 (test-only, no routing change)

Goal: lock down today's literal substring semantics for selected Exclude Filter node names, without silently switching to exact matching. Regex escaping protects metacharacters but does not add ^/$ anchors.

Files: tests/exclude-filter-substring-356.cjs (Node, synthetic, no dependencies/network) and exactly one static+Node step in .github/workflows/generator-ci.yml. No index.html, engine, generated runtime, routing/YAML defaults, subscription requests, stable, Pages, VPS or router changes.

Actual-code test seam: functions buildCombinedExcludeFilter, splitManualExcludeFilter, escapeRegExpText, compileSubscriptionExcludeFilter, serverListExclusionBreakdown extracted directly from current index.html and executed in an isolated Node VM. Synthetic fixtures: A, A-extra, provider: A, Hysteria 2 | Германия, A[1], A+B, for both Sub ON and Sub OFF JS filter contracts. Both manual-regex OR and preview overmatch/dedup accounting tested.

Selected Candidate Generated fragment Expected both modes
A A (?:A) MATCH
A A-extra (?:A) MATCH / overmatch risk
A provider: A (?:A) MATCH (prefix included)
A B (?:A) NO MATCH
Hysteria 2 | Германия same literal escaped pipe MATCH
A[1] A1 escaped brackets NO MATCH
A+B AAAB escaped plus NO MATCH

Evidence scope: Sub ON is source contract + emulated JS regex of emitted filter, not a real Mihomo provider runtime; Sub OFF uses actual Builder compile function. override.additional-prefix is confirmed present in generated engine source but the order of override vs exclude-filter in Mihomo 1.19.31/1.19.33 remains NOT TESTED. No claim of real provider exact-match behavior. #312 remains open.

Start baseline: main=f8f79ce052c5ddff7c3b1f7874fb9604077ac089. Draft only. No merge before owner GO. CI exact-head status to be updated after run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant