- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
如果我运行以下命令
go test -run NotExist
响应为通过。鉴于我的测试文件不包含名为 TestNotExist
的测试,我希望上面的命令返回 FAIL
最佳答案
没有 -run
选项 go test
运行所有测试。您使用 -run
选项不运行所有测试; 过滤掉,排除测试(你以要求非排他性测试的名称匹配 正则表达式模式 - 但这与讨论点无关):
By default, go test needs no arguments. It compiles and tests the package with source in the current directory, including tests, and runs the tests.
-run regexp
Run only those tests and examples matching the regular expression.
过滤过滤掉所有测试是一个完全“正常”的结果,没有测试留在仍然需要执行的测试集中。
当没有测试失败时,它被认为是测试运行通过。如果没有匹配的测试,则不会运行任何测试,也不会失败,因此测试运行将通过。
关于unit-testing - 为什么 `go test -run NotExist` 通过?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38463609/
我正在尝试使用 Files.notExists 方法检查文件夹是否不存在。它适用于我的计算机 (Windows) 中的本地资源,但当我指向共享资源时,它总是返回 false。情况如下: 检查本地资源是
我有以下 SQL, SELECT SKU FROM Products WHERE SKU IN ( 'SKU1', 'SKU2', 'SKU3', 'SKU4', ...
SonarLint 说我应该使用 if(programFolder.toFile().exists) 而不是 if(Files.exists(programFolder))。我一直认为鼓励使用较新的
IMO 拥有这两种方法是多余的,而且真的不清楚!我不太明白为什么这两种方法都是在 Files API 中设计的?? Files.exist(..) 如果文件确实存在则返回 true,如果文件不存在或没
当以下代码执行时: select sum(qty) from inventTrans index hint TransTypeIdx where inventTr
我将 StackExchange.Redis 与配置为使用 Sentinel 的副本集群(3 个节点)一起使用。 我收到多个尝试使用相同数据更新缓存的请求,因此为了避免多次写入,我使用了 When.N
在此查询中(一个简单的示例,我的实际查询更复杂) SELECT SUM(ISNULL(Quantity, 0)) from Product_SalRec where Date between '1-2
如果我运行以下命令 go test -run NotExist 响应为通过。鉴于我的测试文件不包含名为 TestNotExist 的测试,我希望上面的命令返回 FAIL 最佳答案 没有 -run 选项
我是一名优秀的程序员,十分优秀!