Skip to content
Discussion options

You must be logged in to vote

Go Graphics.gd Testing Guide

There are four main types of tests you can implement:

  • Pure Unit Tests: Test pure Go logic without any Godot dependencies.
  • Individual Node Tests: Test single Godot nodes in isolation.
  • Node Integration Tests: Test interactions between Godot nodes without full physics.
  • Physics Integration Tests: Test gameplay mechanics requiring Godot's physics engine.

Pure Unit Tests

Test "pure" mathematical functions and business logic without any Godot dependencies.

These are standard Go tests.

Best for:

  • Linear algebra (vectors, matrices)
  • Game logic that doesn't depend on Godot's scene tree

Example:

func TestDamageCalculation(t *testing.T) {
    damage := calculateDamage(100…

Replies: 5 comments 14 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
7 replies
@Splizard
Comment options

@nii236
Comment options

@nii236
Comment options

@Splizard
Comment options

@nii236
Comment options

Comment options

You must be logged in to vote
5 replies
@Splizard
Comment options

@Splizard
Comment options

@nii236
Comment options

@nii236
Comment options

@Splizard
Comment options

Comment options

You must be logged in to vote
2 replies
@Splizard
Comment options

@nii236
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by nii236
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants