给出的是来自kotlin-test github docs的示例,但我在这里没有看到 beforeEach 或 beforeClass 概念。我想明白,
class MyTests : StringSpec({
"length should return size of string" {
"hello".length shouldBe 5
}
"startsWith should test for a prefix" {
"world" should startWith("wor")
}
})
Run Code Online (Sandbox Code Playgroud) var bool1 = false
var bool2 = false
bool1 === bool2
Run Code Online (Sandbox Code Playgroud)
最后一个语句返回true,这意味着bool1和bool2指向同一个对象实例,我想理解为什么会这样?