另外,assert 的打开和关闭也是受NDEBUG影响。 Tubal opening and closing are also affected by.It only removes assert statements. 例如assert ()检测或在C++层调用的abort()。 Examples include assert () checks or abort() calls in the C++ layer. 图1展示了此类边用于statementAssert . Figure 1 shows a partial example of such edges for the statement Assert .
这些例子包括assert ()检测或在C++层调用的abort()。 Examples include assert () checks or abort() calls in the C++ layer. Expectations are a backwards compatible enhancement to the older assert () function. 但是使用assert ()是保持SQLite可维护性的重要前提。 But the use of assert () is a vital part of keeping SQLite maintainable. Assert 函数只能用于测试内部错误,并检查非变量。The assert function should only be used to test for internal errors, and to check invariants. 在每个测试中,assert 将根据测试结果返回True或False。 In each test, assert will return True or False depending on the test result. Assert 模块提供了一组简单的断言测试,用于测试不变量.The assert module provides a simple set of assertion tests that can be used to test invariants. 在这个例子里,表达式1+1==2的求值结果为True,所以assert 语句没有做任何事情。 In this case, the expression 1+ 1== 2 evaluates to True, so the assert statement does nothing. 如果您的角色未创建该文件且未正确设置内容,则assert 将返回False:. If the file isn't created by your role and the content isn't set properly, assert will return False:. 我想主要原因是assert 不经常使用是因为没有人使用Python的“优化”模式。 I guess the main reason for assert not being used more often is that nobody uses Python's“optimized” mode. 在我们把合约(contracts)添加到语言中之后(下文很快就会介绍),我们也尝试过把assert 设计为一个关键字。 As we moved contracts to the language(more on that soon), we tried making assert a keyword too. Pytest允许您使用标准的pythonassert 用于验证Python测试中的期望和值。 Pytest allows you to use the standard python assert for verifying expectations and values in Python tests. O开关会去除assert 语句,-OO开关会去除assert 语句和__doc__字符串。 The-O switch removes assert statements, the-OO switch removes both assert statements and__doc__ strings. 然而,如果Python表达式求值结果为False,assert 语句会抛出一个AssertionError. However, if the Python expression evaluates to False, the assert statement will raise an AssertionError. Assert ()会检查指定的assertion并在结果为FALSE时采取适当的行动。The assert () function checks the given assertion and takes appropriate actions if the result is FALSE. 但是与C不同的是,函数体内的assert 会抛出AssertException,这个异常可以被捕获并处理。 Unlike C, however, an assert in function bodies works by throwing an AssertError, which can be caught and handled. 以下一些技巧将不仅能够帮助阐明在何时、何地使用ASSERT ,而且还能阐明如何开始正确使用它。 The following tips should help elucidate not only when and where to use ASSERT but also how to begin to use it properly. 虽然Chai提供了两种不同的断言(assertion)编写方式,但现在为了保持简单,我们使用了assert 。 Chai also offers two different styles of writing assertions, but we're using assert to keep things simple for now. 如果使用得当,分析工具可以评估你的合约,并标示出那些会使assert 失败的条件和函数调用。 If used properly, analysis tools can evaluate your contract to identify the conditions and function calls which will reach a failing assert . 这里有一个更好的解决方案,使用assert 语句和Python的basestring的类型一起,它是unicode和str的产生类型。 Here's a better solution, using an assert statement together with Python's basestring type that generalizes over both unicode and str. 他领导了众多Java平台特性的设计和实现,其中包括JavaCollection框架、java.math包以及assert 机制。 He led the design and implementation of various Java feature such as Java Collections Framework, Assert Mechanism, and Java Math package. 通常,assert x==1为false时只会简单的抛出一个AssertionError异常,导致你不知道错误是什么或者哪里出错了。 Normally, writing assert x== 1 would simply throw an AssertionError when false, leaving you with no context for what went wrong or where. Prolog支持许多“非逻辑”或“非逻辑”特性,包括cut,assert 和retract,使用is的算法的变量投影等等。 Prolog supports many"extra-logical" or"non-logical" features, including cut, assert and retract, projection of variables for arithmetic using is, and so forth. 他领导了众多Java平台特性的设计和实现,其中包括JavaCollection框架、java.math包以及assert 机制。 He led the design and implementation of numerous Java platform features, including the Java Collections Framework, the java math package, and the assert mechanism. ASSERT 亦为男性病人提供诊治服务,女病人主要接受脊髓灰质炎、整形问题和肺结核治疗,不过,面临截肢等问题的男性多于女性。ASSERT also treats men and women are treated for polio, orthopaedic problems and tuberculosis, though sees more male clients with conditions such as amputations than women. PHP7.0.0RC1包括27已报告的bug修复,总共200个commits,包括数据库,数组,assert ,streams和其他函数的各种改进。 PHP 7.0.0 RC 1 contains fixes for 27 reported bugs, and altogether over 200 commits with various stability improvements for database, array, assert , streams and other functionality.
Display more examples
Results: 49 ,
Time: 0.0225