From dc6a23d0752243d950b81628124fcaa9b907dabe Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 15 Nov 2025 00:40:08 +0800 Subject: add new apis --- tests/modules/xml/test.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tests/modules/xml/test.lua') diff --git a/tests/modules/xml/test.lua b/tests/modules/xml/test.lua index 841a1c797..60d50d62a 100644 --- a/tests/modules/xml/test.lua +++ b/tests/modules/xml/test.lua @@ -101,3 +101,26 @@ function test_plist_sample(t) t:are_equal(last_flag.name, "true") end +function test_scan_stop(t) + local plist = [[ + + + + + CFBundleExecutable + $(EXECUTABLE_NAME) + NSPrincipalClass + NSApplication + +]] + local found + xml.scan(plist, function(node) + if node.name == "key" and xml.text_of(node) == "NSPrincipalClass" then + found = node + return false + end + end) + t:are_equal(found ~= nil, true) + t:are_equal(xml.text_of(found), "NSPrincipalClass") +end + -- cgit v1.3.1