From 23e6ba8cc2de65cb79fedf9827731040ddd4bdf5 Mon Sep 17 00:00:00 2001 From: Brett Vickers Date: Thu, 14 Nov 2019 15:26:41 -0800 Subject: Add namespace-attribute path search unit tests. --- path_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/path_test.go b/path_test.go index 0e02227..ed0b570 100644 --- a/path_test.go +++ b/path_test.go @@ -24,7 +24,7 @@ var testXML = ` Harry Potter J K. Rowling 2005 - 29.99 + 29.99 @@ -61,7 +61,6 @@ type test struct { type errorResult string var tests = []test{ - // basic queries {"./bookstore/book/title", []string{"Everyday Italian", "Harry Potter", "XQuery Kick Start", "Learning XML"}}, {"./bookstore/book/author", []string{"Giada De Laurentiis", "J K. Rowling", "James McGovern", "Per Bothner", "Kurt Cagle", "James Linn", "Vaidyanathan Nagarajan", "Erik T. Ray"}}, @@ -121,6 +120,10 @@ var tests = []test{ {"./bookstore/book[@category='COOKING']/title[@lang='en']", "Everyday Italian"}, {"./bookstore/book/title[@lang='en'][@sku='150']", "Harry Potter"}, {"./bookstore/book/title[@lang='fr']", nil}, + {"//p:price[@p:tax='1.99']", []string{"29.99"}}, + {"//p:price[@tax='1.99']", []string{"29.99"}}, + {"//p:price[@p:tax]", []string{"29.99"}}, + {"//p:price[@tax]", []string{"29.99"}}, // parent queries {"./bookstore/book[@category='COOKING']/title/../../book[4]/title", "Learning XML"}, -- cgit v1.2.3