lisette-stdlib 0.1.15

Little language inspired by Rust that compiles to Go
Documentation
// Generated by Lisette bindgen
// Source: testing/quick (Go stdlib)
// Go: 1.25.5
// Lisette: 0.1.14

import "go:math/rand"
import "go:reflect"

/// Check looks for an input to f, any function that returns bool,
/// such that f returns false. It calls f repeatedly, with arbitrary
/// values for each argument. If f returns false on a given input,
/// Check returns that input as a *[CheckError].
/// For example:
/// 
/// 	func TestOddMultipleOfThree(t *testing.T) {
/// 		f := func(x int) bool {
/// 			y := OddMultipleOfThree(x)
/// 			return y%2 == 1 && y%3 == 0
/// 		}
/// 		if err := quick.Check(f, nil); err != nil {
/// 			t.Error(err)
/// 		}
/// 	}
pub fn Check(f: Unknown, config: Ref<Config>) -> Result<(), error>

/// CheckEqual looks for an input on which f and g return different results.
/// It calls f and g repeatedly with arbitrary values for each argument.
/// If f and g return different answers, CheckEqual returns a *[CheckEqualError]
/// describing the input and the outputs.
pub fn CheckEqual(f: Unknown, g: Unknown, config: Ref<Config>) -> Result<(), error>

/// Value returns an arbitrary value of the given type.
/// If the type implements the [Generator] interface, that will be used.
/// Note: To create arbitrary values for structs, all the fields must be exported.
pub fn Value(t: reflect.Type, rand: Ref<rand.Rand>) -> Option<reflect.Value>

/// A CheckEqualError is the result [CheckEqual] finding an error.
pub struct CheckEqualError {
  pub CheckError: CheckError,
  pub Out1: Slice<Unknown>,
  pub Out2: Slice<Unknown>,
}

/// A CheckError is the result of Check finding an error.
pub struct CheckError {
  pub Count: int,
  pub In: Slice<Unknown>,
}

/// A Config structure contains options for running a test.
pub struct Config {
  pub MaxCount: int,
  pub MaxCountScale: float64,
  pub Rand: Option<Ref<rand.Rand>>,
  pub Values: fn(Slice<reflect.Value>, Ref<rand.Rand>) -> (),
}

/// A Generator can generate random values of its own type.
pub interface Generator {
  fn Generate(rand: Ref<rand.Rand>, size: int) -> reflect.Value
}

/// A SetupError is the result of an error in the way that check is being
/// used, independent of the functions being tested.
pub struct SetupError(string)

impl CheckEqualError {
  fn Error(self: Ref<CheckEqualError>) -> string
}

impl CheckError {
  fn Error(self: Ref<CheckError>) -> string
}

impl SetupError {
  fn Error(self) -> string
}