# At the time this test was developed, 4XSLT treated "ns1 != ns2" the same
# as "not(ns1 = ns2)" when evaluated in a predicate.
#
# The expected behavior is as follows:
#
# ns1 = ns2
# true if any node in ns1 has the same string-value as any node in ns2
#
# ns1 != ns2
# true if any node in ns1 has a different string-value than any node in ns2
#
# not(ns1 = ns2)
# true if no node in ns1 has the same string-value as any node in ns2
#
from Xml.Xslt import test_harness
source_1 = """\
hello
world
world
bazaar
totally
different
"""
sheet_1 = """\
"""
expected_1 = """\
set1 = set1: true
set2 = set2: true
set3 = set3: true
set1 = set2: true
set1 = set3: false
set2 = set3: false
set1 != set1: true
set2 != set2: true
set3 != set3: true
set1 != set2: true
set1 != set3: true
set2 != set3: true
not(set1 = set1): false
not(set2 = set2): false
not(set3 = set3): false
not(set1 = set2): false
not(set1 = set3): true
not(set2 = set3): true
"""
sheet_2 = """\
"""
expected_2 = """\
hello
world
hello
world
world
bazaar
world
bazaar
totally
different
totally
different
"""
sheet_3 = """\
"""
expected_3 = """\
hello
hello
world
bazaar
world
bazaar
totally
different
totally
different
"""
def Test(tester):
source = test_harness.FileInfo(string=source_1)
sheet = test_harness.FileInfo(string=sheet_1)
xtest = test_harness.XsltTest(tester, source, [sheet], expected_1,
title='Case 1')
source = test_harness.FileInfo(string=source_1)
sheet = test_harness.FileInfo(string=sheet_2)
test_harness.XsltTest(tester, source, [sheet], expected_2,
title='Case 2')
source = test_harness.FileInfo(string=source_1)
sheet = test_harness.FileInfo(string=sheet_3)
test_harness.XsltTest(tester, source, [sheet], expected_3,
title='Case 3')
return