From 6e8adbaabedba12e81bf0fdfe3dc42108255bd11 Mon Sep 17 00:00:00 2001 From: Bobby Date: Wed, 22 Apr 2026 07:51:18 +0530 Subject: Migrate remaining relative imports to @hollowdark/*; strip //-comments and doc references, JSDoc-only --- tests/determinism/rng.test.ts | 8 -------- tests/unit/time/calendar.test.ts | 8 ++++---- tests/unit/time/gameTime.test.ts | 4 ---- tests/unit/utils/result.test.ts | 1 - 4 files changed, 4 insertions(+), 17 deletions(-) (limited to 'tests') diff --git a/tests/determinism/rng.test.ts b/tests/determinism/rng.test.ts index 57a1e10..5d003b0 100644 --- a/tests/determinism/rng.test.ts +++ b/tests/determinism/rng.test.ts @@ -157,8 +157,6 @@ describe('createRNG — output shape', () => { ]) if (pick === 'rare') lowCount++ } - // Expected ~5, allow plenty of slack for variance; just confirm the - // distribution isn't inverted. expect(lowCount).toBeLessThan(50) }) @@ -212,15 +210,9 @@ describe('SeededRNG.sub — sub-RNG derivation', () => { }) describe('byte-level determinism snapshot', () => { - // Locks the PRNG implementation. Saved worlds depend on exact byte - // reproduction — if this test breaks, it means the PRNG changed, and - // every existing save relying on this seed will diverge. Treat failure - // as a migration concern, not a "just update the snapshot" fix. test('createRNG("hollowdark").next() × 5 matches canonical sequence', () => { const rng = createRNG('hollowdark') const first5 = [rng.next(), rng.next(), rng.next(), rng.next(), rng.next()] - // Values computed from the current mulberry32 + xmur3 implementation. - // Reproducible locally via: createRNG('hollowdark').next() × 5. expect(first5).toMatchInlineSnapshot(` [ 0.14088608953170478, diff --git a/tests/unit/time/calendar.test.ts b/tests/unit/time/calendar.test.ts index ee8d789..efbec97 100644 --- a/tests/unit/time/calendar.test.ts +++ b/tests/unit/time/calendar.test.ts @@ -72,10 +72,10 @@ describe('monthSeason', () => { }) test('specific month → season mappings', () => { - expect(monthSeason(1)).toBe('spring') // Thawing - expect(monthSeason(4)).toBe('summer') // Highsun - expect(monthSeason(7)).toBe('autumn') // Firstfall - expect(monthSeason(10)).toBe('winter') // Rainfall + expect(monthSeason(1)).toBe('spring') + expect(monthSeason(4)).toBe('summer') + expect(monthSeason(7)).toBe('autumn') + expect(monthSeason(10)).toBe('winter') expect(monthSeason(13)).toBe('festival') }) }) diff --git a/tests/unit/time/gameTime.test.ts b/tests/unit/time/gameTime.test.ts index ca6f4b1..9503e60 100644 --- a/tests/unit/time/gameTime.test.ts +++ b/tests/unit/time/gameTime.test.ts @@ -137,7 +137,6 @@ describe('addWeeks', () => { }) test('52 weeks lands in the festival, not at next year', () => { - // 52 × 7 = 364 days; Thawing 1 + 364 = Festival 5 (day 365 - 1) expect(addWeeks(makeGameTime(1111, 1, 1), 52)).toMatchObject({ year: 1111, month: 13, @@ -146,8 +145,6 @@ describe('addWeeks', () => { }) test('negative weeks moves backward', () => { - // Greening 1 (doy 31) minus 7 days = Thawing 24 (doy 24). - // Months are 30 days in this calendar, not 31. expect(addWeeks(makeGameTime(1111, 2, 1), -1)).toMatchObject({ year: 1111, month: 1, @@ -174,7 +171,6 @@ describe('addMonths', () => { }) test('overflow into next year wraps through the 13-month cycle', () => { - // Rimefrost 15 + 2 months → Festival → Thawing next year, day preserved (15) expect(addMonths(makeGameTime(1111, 12, 15), 2)).toMatchObject({ year: 1112, month: 1, diff --git a/tests/unit/utils/result.test.ts b/tests/unit/utils/result.test.ts index bdd4923..49cf86f 100644 --- a/tests/unit/utils/result.test.ts +++ b/tests/unit/utils/result.test.ts @@ -67,7 +67,6 @@ describe('type-narrowing', () => { test('isOk narrows to Ok', () => { const r: Result = ok(10) if (isOk(r)) { - // Type-level check — if isOk doesn't narrow, this line fails to compile. const n: number = r.value expect(n).toBe(10) } else { -- cgit v1.2.3