aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Vickers <brett@beevik.com>2019-11-14 15:26:41 -0800
committerBrett Vickers <brett@beevik.com>2019-11-14 15:26:41 -0800
commit23e6ba8cc2de65cb79fedf9827731040ddd4bdf5 (patch)
treef6feeae440eb06fd0434b5ffe4a31a448d94d346
parentdcd53a58ac74b465a34228d599f14376ccdcc6ab (diff)
downloadgo-etree-23e6ba8cc2de65cb79fedf9827731040ddd4bdf5.tar.gz
Add namespace-attribute path search unit tests.
-rw-r--r--path_test.go7
1 files 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 = `
<title lang="en" sku="150">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
- <p:price>29.99</p:price>
+ <p:price p:tax="1.99">29.99</p:price>
<editor></editor>
<editor/>
</book>
@@ -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"},