rust

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesAsHex

func BytesAsHex(t *testing.T, b []byte) string

byte slice in Rust syntax (without enclosing brackets, ie just values of bytes separated by comma).

func Option

func Option(t *testing.T, v any) string

Option returns v as Rust value wrapped to Option.

The zero value of the type (ie 0 for int or "" for string) is encoded as "None", otherwise as "Some". For byte slices nil is encoded as None while empty slice is encoded as Some.

func TestFile

func TestFile(t *testing.T, filename, src string) *os.File

TestFile creates file with name "filename" in the directory denoted by the UBFT_RUST_SDK_ROOT environment variable (ie the filename should be relative to that path). If the env var is not set (empty) the test "t" will be skipped.

The "src" will be written into the file, ie this can be used to set the file header, initial module imports etc.

If the file "filename" already exists it will be truncated. The file will be automatically closed at the end of the test "t".

To generate tests using this function run

UBFT_RUST_SDK_ROOT="/path/to/rust-predicates-sdk" go test ./...

func Value

func Value(t *testing.T, v any) string

Value returns v as Rust SDK Value enum.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL