我正在使用Erlang的EUnit来测试应用程序的单元。 我想断言一定的测试值是2和3之间There's no built-in support for this,所以我试图用一对后卫的,是这样的: myTestCase ->
?assertMatch({ok, V} when V>2, V<3,
unitUnderTest() % expected to return
我在我的代码中发现了一个错误。在开始一个switch语句的新案例之前,我简单地忘记了break;。所以,代码看起来像 switch (nCounter)
{
case 1:
*dReturnValue = 1.;
// here should have been a break;
case 2:
*dReturnValue = 2.;
break;