Our simple testable class will return whatever string we pass in, so let's start evaluating the results. If we were coding raw JUnit classes we would write something like this
我们建立的简单的可测试的类将返回传递的任何字符串,所以让我们评估一下这个结果。
We intended for makeList to return a List[String], but when strings.length equals zero, we returned List(0), incorrectly “assuming” that this expression is the correct way to create an empty list.
我们希望makeList 能返回一个List[String],但是当strings.length 等于0 时,我们错误地假设List(0) 是一个空的列表并且将其返回。
In all other cases where we cannot find the beginning of a tag, we return the empty string.
在无法找到标签开头的其他所有情况下,我们返回一个空字符串。
And when we return the string to you we're essentially telling you where this chunk of memory is.
当我们返回该字符串时,我们实际上是告诉你,这块存储单元位于哪里。
应用推荐