From 281af49d2749820b02c96390b8e9caa8178c56ad Mon Sep 17 00:00:00 2001 From: edmand46 Date: Thu, 26 Mar 2026 16:03:52 +0300 Subject: [PATCH] fix: tests.yml --- .github/workflows/tests.yml | 3 ++- testdata/lua/sample.go | 39 +++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 testdata/lua/sample.go diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6d09feb..ad4785b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -69,7 +69,8 @@ jobs: - name: Test code generation run: | - go run ./cmd/arpack -in testdata/sample.go -out-go /tmp/gen-go -out-ts /tmp/gen-ts -out-lua /tmp/gen-lua + go run ./cmd/arpack -in testdata/sample.go -out-go /tmp/gen-go -out-ts /tmp/gen-ts + go run ./cmd/arpack -in testdata/lua/sample.go -out-lua /tmp/gen-lua test -f /tmp/gen-go/sample_gen.go test -f /tmp/gen-ts/Sample.gen.ts test -f /tmp/gen-lua/sample_gen.lua diff --git a/testdata/lua/sample.go b/testdata/lua/sample.go new file mode 100644 index 0000000..3ecfb4f --- /dev/null +++ b/testdata/lua/sample.go @@ -0,0 +1,39 @@ +package lua + +type Vector3 struct { + X float32 `pack:"min=-500,max=500,bits=16"` + Y float32 `pack:"min=-500,max=500,bits=16"` + Z float32 `pack:"min=-500,max=500,bits=16"` +} + +type Opcode uint16 + +const ( + OpcodeUnknown Opcode = iota + OpcodeAuthorize + OpcodeJoinRoom +) + +type MoveMessage struct { + Position Vector3 + Velocity [3]float32 + Waypoints []Vector3 + PlayerID uint32 + Active bool + Visible bool + Ghost bool + Name string +} + +type SpawnMessage struct { + EntityID uint32 + Position Vector3 + Health int16 + Tags []string + Data []uint8 +} + +type EnvelopeMessage struct { + Code Opcode + Counter uint8 +}