libhoare:Rust 的契约式断言设计

时间:2021-05-30 09:54:06
【文件属性】:
文件名称:libhoare:Rust 的契约式断言设计
文件大小:18KB
文件格式:ZIP
更新时间:2021-05-30 09:54:06
Rust LibHoare 通过契约式断言对设计的简单 Rust 支持。 支持 先决条件( precond ), 后置条件( postcond ), 不变量(前和后)( invariant )。 每个宏都采用作为字符串参数给出的谓词。 每个宏都在debug_版本中可用,它只检查调试版本中的断言,在非调试版本中它们应该是零开销。 您可以在后置条件中使用result来获取函数返回的值。 在进入功能时检查前提条件。 通过任何路径离开函数时都会检查后置条件。 (图书馆以托尼命名,而不是格雷登。或者更确切地说,它是以托尼命名的逻辑命名的)。 使用 libhoare 您可以通过添加将 libhoare 与 Cargo 一起使用 [ dependencies . hoare ] git = " https://github.com/nick29581/libhoare.git " 到您的项目货运清
【文件预览】:
libhoare-master
----.travis.yml(140B)
----readme.md(4KB)
----tests-cfail()
--------cfail-3.rs(679B)
--------cfail-2.rs(682B)
--------cfail-6.rs(675B)
--------cfail-1.rs(678B)
--------cfail-4.rs(680B)
--------cfail-5.rs(676B)
----tests()
--------test_trivial.rs(5KB)
--------test_with_methods.rs(1KB)
----test.sh(791B)
----Cargo.toml(272B)
----examples()
--------lexer.rs(6KB)
--------doc.rs(1KB)
--------hello.rs(1KB)
----.gitignore(18B)
----tests-release()
--------test_release.rs(749B)
----libhoare()
--------lib.rs(16KB)

网友评论