这是我的 groovy 文件的内容:
def KEY = "a"
Properties myProp = new Properties()
myProp[KEY] = "b"
assert(myProp[KEY] == myProp.getProperty(KEY))
Properties results = new Properties(myProp)
assert(results[KEY] == results.getProperty(KEY))
我希望两个断言都能通过,但只有第一个断言通过,第二个断言失败。
对此的任何解释都非常感谢。谢谢!