compliance

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileGoToTypeScript

func CompileGoToTypeScript(t *testing.T, testDir, tempDir, outputDir string, le *logrus.Entry)

func PrepareTempTestDir

func PrepareTempTestDir(t *testing.T, testDir string) string

PrepareTempTestDir creates a temp dir, copies .go files, and writes go.mod. Returns tempDir path.

func ReadExpectedLog

func ReadExpectedLog(t *testing.T, testDir string) string

ReadExpectedLog reads expected.log from testDir.

func RunGoScriptTestDir

func RunGoScriptTestDir(t *testing.T, workspaceDir, testDir string)

RunGoScriptTestDir compiles all .go files in testDir, runs the generated TypeScript, and compares output to expected.log.

func RunTypeScriptRunner

func RunTypeScriptRunner(t *testing.T, workspaceDir, tempDir, tsRunner string) string

RunTypeScriptRunner runs the runner.ts file using tsx and returns its stdout.

func RunTypeScriptTypeCheck added in v0.0.16

func RunTypeScriptTypeCheck(t *testing.T, workspaceDir, testDir string, tsconfigPath string)

RunTypeScriptTypeCheck runs tsc --project tsconfig.json to typecheck the generated .gs.ts files.

func WriteTypeCheckConfig added in v0.0.16

func WriteTypeCheckConfig(t *testing.T, workspaceDir, testDir string) string

WriteTypeCheckConfig writes a tsconfig.json file in the test directory that extends the root tsconfig.json

func WriteTypeScriptRunner

func WriteTypeScriptRunner(t *testing.T, testDir, tempDir string) string

WriteTypeScriptRunner writes a runner.ts file to tempDir.

Types

type TestCase

type TestCase struct {
	Name           string
	GoSource       string
	ExpectedOutput string
}

TestCase defines a single Go-to-TypeScript compliance test.

Directories

Path Synopsis
tests
array_literal command
assign_op command
async_basic command
boolean_logic command
boxing command
boxing_assign command
boxing_pointers command
boxing_struct command
channel_basic command
comments_struct command
constants command
defer_statement command
flag_bitwise_op command
float64 command
for_loop_basic command
for_post_incdec command
for_range command
func_literal command
goroutines command
Package main tests goroutine handling with named functions
Package main tests goroutine handling with named functions
if_statement command
map_support command
pointers command
simple command
slice command
wip command

Jump to

Keyboard shortcuts

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