Skip to content

string comparison size error #80

@weienjun

Description

@weienjun

use xmlquery find func, use string comparison size exist error, i think cmpStringStringF have bug。

example:
test data: ab
find expr: /res/value[data > "a"]
expected: b
output: a

`// operator.go
func cmpNodeSetString(t iterator, op string, m, n interface{}) bool {

a := m.(query)
b := n.(string)
for {
	node := a.Select(t)
	if node == nil {
		break
	}
           // this is errror
	if cmpStringStringF(op, b, node.Value()) {
		return true
	}
            // this is should 
	//if cmpStringStringF(op, node.Value(),b) {
	//	return true
	//}
}
return false

}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions