consistency API
用途
consistency 是一个白盒测试包。它不导出任何 MoonBit 项;其内容是一套约 250 个确定性测试(在当前分支上,api_audit_wbtest.mbt 中有 28 个,core_wbtest.mbt 中有 228 个),用于检查跨越 floating 各包的规律:二进制、十进制、GDA 和区间核心,它们的 checked 包装,semantic,以及共享的 internal 辅助函数,彼此之间以及与精确的 BigInt 和有理数预言机之间是否一致。本页记录该包的作用及其(空的)接口;教程介绍如何运行和扩展它,设计页面解释检查了哪些内容。
导入
无法从 consistency 导入任何内容。它是工具模块 Luna-Flow/floating-tools 的一个包;其 moon.pkg 仅为白盒测试导入库的各核心:
import {
"Luna-Flow/arithmetic" @lf_arith,
"Luna-Flow/luna-generic" @lf_alg,
"Luna-Flow/floating/binary",
"Luna-Flow/floating/binary_checked",
"Luna-Flow/floating/decimal",
"Luna-Flow/floating/decimal_checked",
"Luna-Flow/floating/decimal_gda",
"Luna-Flow/floating/decimal_gda_checked",
"Luna-Flow/floating/interval",
"Luna-Flow/floating/interval_checked",
"Luna-Flow/floating/def",
"Luna-Flow/floating/internal",
"Luna-Flow/floating-tools/semantic",
} for "wbtest"
测试文件
| 文件 | 内容 |
|---|---|
api_audit_wbtest.mbt | 对跨包公开行为的审计:def 谓词、internal 的舍入与解析辅助函数、错误与上下文类型、十进制交换格式门面(逐位精确的编码、规范性谓词、符号操作)、binary 的 checked 比较、通过 Luna-Flow/arithmetic 使用的泛型 checked trait,以及二进制、十进制和区间值的 semantic 解释 |
core_wbtest.mbt | 跨包的算术规律:internal 的数字与截尾辅助函数对照 BigInt 的检验、binary 在二进有理数上的精确性及泛型 trait 用法、decimal 与 decimal_gda 的同值类(cohort)、有符号零及 NaN 载荷规则(许多行取自官方 decTest 套件)、interval 的包络性质、checked 流水线的封闭性,以及全域构造函数 |
bin_coeff_migration_wbtest.mbt | 为上述测试从 BigInt 构建 Binary 值的辅助函数 |
所有测试都是白盒测试(*_wbtest.mbt),且只在 wbtest 中导入各核心包,因此该包不会给库的任何构建增加内容。
完整公共接口
该包不导出任何 MoonBit 项。
// Generated using `moon info`, DON'T EDIT IT
package "Luna-Flow/floating-tools/consistency"
// Values
// Errors
// Types and methods
// Type aliases
// Traits