vmcompare

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package vmcompare provides systematic VM opcode verification by comparing go-lua execution output against C Lua 5.5.1 reference output.

For each opcode, a minimal Lua snippet is run on both VMs and stdout is compared.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareVM

func CompareVM(t *testing.T, tc vmTest) (bool, string, string)

CompareVM runs a test case on both VMs and compares normalized output. Returns (match bool, cOutput string, goOutput string).

func Normalize

func Normalize(s string) string

Normalize output for comparison: trim trailing whitespace per line, normalize NaN/inf representations, trim trailing newline.

func RunCLua

func RunCLua(t *testing.T, code string) string

RunCLua executes Lua code with C Lua and returns stdout.

func RunGoLua

func RunGoLua(t *testing.T, code string) string

RunGoLua executes Lua code with go-lua and returns captured print output. Replaces the global print with a buffer-capturing version.

Types

This section is empty.

Jump to

Keyboard shortcuts

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