From 88956d600745c6541b59711ee0a3cb630dbfd793 Mon Sep 17 00:00:00 2001 From: Bob Date: Sat, 26 Sep 2026 19:57:00 +0000 Subject: [PATCH] test(queries): pin escape_doublequote actually escapes quotes Regression test for the JS-style regex bug fixed in #109, which shipped without a test. Git-Session-Id: 3d60 --- tests/test_queries.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_queries.py b/tests/test_queries.py index 402a39a..3241ef8 100644 --- a/tests/test_queries.py +++ b/tests/test_queries.py @@ -401,3 +401,15 @@ def test_browser_bucket_not_matched_by_hostname(): assert dict(browsersWithBuckets(buckets[2:])) == { "firefox": "aw-watcher-web-firefox-synced-from-chrome-box" } + + +from aw_client.queries import escape_doublequote + + +def test_escape_doublequote(): + # Regression: this once used a JS-style regex ('/"/g') and never matched. + assert ( + escape_doublequote('aw-watcher-window_"host"') == 'aw-watcher-window_\\"host\\"' + ) + assert escape_doublequote("no quotes") == "no quotes" + assert escape_doublequote("") == ""