package odin-algebra:prop_based
⌘K
Ctrl+K
or
/
Index
Constants (2)
Variables (1)
Procedure Groups (1)
Types
Generator ¶
Generator :: struct($T: typeid) { … // See source for fields }
Note on implementing your own generator: T: is the expected output type of the generator raw: allows your other functions to access any nessisary state generate: called to generate a random value of type T reduce: called to find a smaller counter example. Given an input of type T it should randomly generate a smaller example that might also fail the proposition. delete: called to free values of type T print: called to print values of type T when the proposition is falsefied
Related Procedures With Parameters
- check_1
- check_2
- check_3
- log_args_1
- log_args_2
- log_args_3
- check (procedure groups)
PropBasedLogMessage ¶
PropBasedLogMessage :: struct { level: runtime.Logger_Level, text: untyped string, }
PropBasedTestState ¶
PropBasedTestState :: struct { logs: [dynamic]PropBasedLogMessage, logger: runtime.Logger, logger_data: CheckLoggerData, }
Constants
GENERATOR_F32 ¶
GENERATOR_F32: Generator($T=f32) : Generator(f32){nil, generate_f32, reduce_f32, delete_f32, print_f32}
GENERATOR_I64 ¶
GENERATOR_I64: Generator($T=i64) : Generator(i64){nil, generate_i64, reduce_i64, delete_i64, print_i64}
Variables
prop_based_test_state ¶
@(thread_local) prop_based_test_state: PropBasedTestState
Procedures
check_1 ¶
check_1 :: proc( t: ^testing.T, state: $S, g: Generator($T), predicate: proc($S, $T) -> bool, itterations: untyped integer = 100, loc := #caller_location, ) {…}
check_2 ¶
check_2 :: proc( t: ^testing.T, state: $S, g_1: Generator($T), g_2: Generator($T), predicate: proc($S, $T, $U) -> bool, itterations: untyped integer = 100, loc := #caller_location, ) {…}
check_debug_assertion_failure_proc ¶
check_debug_assertion_failure_proc :: proc(prefix, message: untyped string, loc := #caller_location) -> ! {…}
check_logger_proc ¶
check_logger_proc :: proc(logger_data_raw: rawptr, level: runtime.Logger_Level, text: untyped string, options: bit_set[runtime.Logger_Option], location := #caller_location) {…}
delete_f32 ¶
delete_f32 :: proc(old: f32) {…}
delete_i64 ¶
delete_i64 :: proc(old: i64) {…}
delete_state ¶
delete_state :: proc() {…}
log_args_1 ¶
log_args_1 :: proc(a_1: ^$T, g_1: Generator($T)) {…}
print_falsification ¶
print_falsification :: proc(loc := #caller_location) {…}
reset_state ¶
reset_state :: proc(t: ^testing.T) {…}
Procedure Groups
Source Files
Generation Information
Generated with odin version dev-2025-04 (vendor "odin") Linux_amd64 @ 2025-05-13 09:15:55.506154180 +0000 UTC