aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-04-22 07:51:18 +0530
committerBobby <[email protected]>2026-04-22 07:51:18 +0530
commit6e8adbaabedba12e81bf0fdfe3dc42108255bd11 (patch)
tree6d0cb2f5d6d029ea93432a1f906ab74bcdfb7917 /tests
parent22912c4af19b9055ed95779c4d16020fe3a449eb (diff)
downloadhollowdark-6e8adbaabedba12e81bf0fdfe3dc42108255bd11.tar.xz
hollowdark-6e8adbaabedba12e81bf0fdfe3dc42108255bd11.zip
Migrate remaining relative imports to @hollowdark/*; strip //-comments and doc references, JSDoc-only
Diffstat (limited to 'tests')
-rw-r--r--tests/determinism/rng.test.ts8
-rw-r--r--tests/unit/time/calendar.test.ts8
-rw-r--r--tests/unit/time/gameTime.test.ts4
-rw-r--r--tests/unit/utils/result.test.ts1
4 files changed, 4 insertions, 17 deletions
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<T>', () => {
const r: Result<number, string> = 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 {