Refactor evaluator functions in JSON examples to use URL pattern matching. Update expected URL formats to regex patterns for better validation in chrome evaluation examples.

This commit is contained in:
Timothyxxx
2025-10-01 19:20:06 +00:00
parent 9be518435c
commit 1572068035
2 changed files with 16 additions and 17 deletions

View File

@@ -43,7 +43,7 @@
"chrome"
],
"evaluator": {
"func": "is_expected_active_tab",
"func": "is_expected_url_pattern_match",
"result": {
"type": "active_url_from_accessTree",
"goto_prefix": "https://www."
@@ -51,8 +51,9 @@
"expected": {
"type": "rule",
"rules": {
"type": "url",
"url": "https://www.dmv.virginia.gov/licenses-ids/license/applying/eligibility"
"expected": [
"^https://(www\\.)?dmv\\.virginia\\.gov/licenses-ids/license/applying/eligibility"
]
}
}
},

View File

@@ -44,37 +44,35 @@
],
"evaluator": {
"func": [
"exact_match",
"exact_match"
"is_expected_url_pattern_match",
"is_expected_url_pattern_match"
],
"conj": "or",
"result": [
{
"type": "url_dashPart",
"goto_prefix": "https://www.",
"partIndex": -1,
"needDeleteId": false,
"returnType": "string"
"type": "active_url_from_accessTree",
"goto_prefix": "https://www."
},
{
"type": "url_dashPart",
"goto_prefix": "https://www.",
"partIndex": -1,
"needDeleteId": false,
"returnType": "string"
"type": "active_url_from_accessTree",
"goto_prefix": "https://www."
}
],
"expected": [
{
"type": "rule",
"rules": {
"expected": "tamiflu.html#side-effects"
"expected": [
"^https://(www\\.)?drugs\\.com/tamiflu\\.html#side-effects"
]
}
},
{
"type": "rule",
"rules": {
"expected": "tamiflu-side-effects.html"
"expected": [
"^https://(www\\.)?drugs\\.com/sfx/tamiflu-side-effects\\.html"
]
}
}
]