使用 perl 5.16 和最新的 Test::More 模块。
我有一个单元测试被称为
is($ret, "ssh: connect to host 1.2.3.187 port 22: Network is unreachable\nCouldn't read packet: Connection reset by peer\n", "putFileWithSFTP bad server ret test");
运行测试失败,结果如下:
# Failed test 'putFileWithSFTP bad server ret test'
# at t/Backup.t line 891.
# got: 'ssh: connect to host 1.2.3.187 port 22: Network is unreachable
# Couldn't read packet: Connection reset by peer
# '
# expected: 'ssh: connect to host 1.2.3.187 port 22: Network is unreachable
# Couldn't read packet: Connection reset by peer
# '
字符串应该相等,而且它们看起来也相等。可能是什么原因造成的?
最佳答案
关于unit-testing - 测试::使用相同的字符串进行更多失败的测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74094932/