我在测试文件中有以下代码:
println("myVarXml: " + myVarXml)
println("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n</HDStream>")
输出:
myVarXml: <?xml version="1.0" encoding="iso-8859-1"?>
</HDStream>
<?xml version="1.0" encoding="iso-8859-1"?>
</HDStream>
和
assert(myVarXml == "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n</HDStream>")
输出:
]
</HDStream>" did not equal "...oding="iso-8859-1"?>[]
</HDStream>"
字符串是相同的。为什么断言失败?