Skip to content

Commit

Permalink
fix 99. add non-english letter test.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengchun committed Jul 24, 2024
1 parent 4286dab commit 14e235f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions xpath_expression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,21 @@ func TestGreekAttributesInXPath_NoMatch(t *testing.T) {
div.lines = 1
test_xpath_elements(t, doc, `//div[@γλώσσα='αγγλικά']`)
}

func TestNonEnglishExpression(t *testing.T) {
doc := createNode("", RootNode)
n_1 := doc.createChildNode("Σειρά", ElementNode)
n_1.lines = 1
n_2 := n_1.createChildNode("ελληνικά", ElementNode)
n_2.lines = 2
n_2.createChildNode("hello", TextNode)
test_xpath_elements(t, doc, "//Σειρά", 1)
test_xpath_values(t, doc, "//Σειρά/ελληνικά", "hello")
}

func TestChineseCharactersExpression(t *testing.T) {
doc := createNode("", RootNode)
n := doc.createChildNode("中文", ElementNode)
n.createChildNode("你好世界", TextNode)
test_xpath_values(t, doc, "//中文", "你好世界")
}

0 comments on commit 14e235f

Please sign in to comment.