aboutsummaryrefslogtreecommitdiff
path: root/internal/combat/types_test.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-07-01 22:30:31 -0400
committerhistoria <[not public]>2026-07-01 22:30:31 -0400
commitc14c2e403c75a913e1a6d962fb6fe64f013adae5 (patch)
tree75070293fe2535b594ac72e501cbf08a3f1146e0 /internal/combat/types_test.go
parent8eec7b75ff9c8c368b252373db45fb891732d2ca (diff)
downloadthehouseoficarus-c14c2e403c75a913e1a6d962fb6fe64f013adae5.tar.gz
fix: combat formulas and mob attack types (mobs switch attack styles if safespotting)
Diffstat (limited to 'internal/combat/types_test.go')
-rw-r--r--internal/combat/types_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/internal/combat/types_test.go b/internal/combat/types_test.go
new file mode 100644
index 0000000..a999eb6
--- /dev/null
+++ b/internal/combat/types_test.go
@@ -0,0 +1,30 @@
+package combat
+
+import "testing"
+
+func TestIsMeleeType(t *testing.T) {
+ melee := []string{AttackStab, AttackSlash, AttackCrush}
+ for _, m := range melee {
+ if !IsMeleeType(m) {
+ t.Errorf("IsMeleeType(%q) = false, want true", m)
+ }
+ }
+ for _, nm := range []string{AttackRanged, AttackScience, "", "magic"} {
+ if IsMeleeType(nm) {
+ t.Errorf("IsMeleeType(%q) = true, want false", nm)
+ }
+ }
+}
+
+func TestIsValidAttackType(t *testing.T) {
+ for _, v := range AllAttackTypes {
+ if !IsValidAttackType(v) {
+ t.Errorf("IsValidAttackType(%q) = false, want true", v)
+ }
+ }
+ for _, iv := range []string{"", "magic", "melee"} {
+ if IsValidAttackType(iv) {
+ t.Errorf("IsValidAttackType(%q) = true, want false", iv)
+ }
+ }
+}