Skip to content

test: Add comprehensive tests (fixes #13)#18

Merged
smiley-maker merged 1 commit intosmiley-maker:mainfrom
majiayu000:feature/issue-13-more-tests
Dec 15, 2025
Merged

test: Add comprehensive tests (fixes #13)#18
smiley-maker merged 1 commit intosmiley-maker:mainfrom
majiayu000:feature/issue-13-more-tests

Conversation

@majiayu000
Copy link
Contributor

Summary

Add 25 new comprehensive tests covering all requirements from Issue #13.

Tests Added

1. Registry with Strings

  • Optimizer accepts string personality names
  • All registered personalities are resolvable
  • Unknown personality strings raise KeyError

2. Registry with Objects

  • Optimizer accepts function personalities
  • Optimizer accepts class instance personalities
  • Optimizer accepts lambda personalities

3. Adding to Registry

  • Can register new personalities
  • Can register class-based personalities
  • Cannot overwrite without flag
  • Can overwrite with explicit flag

4. Specific Personality Tests

  • Wholesome behavior (first step, decrease, increase)
  • Sassy behavior (first step, decrease, increase)
  • QuietPersonality respects interval

5. message_every Smoothing and Averages

  • Counts steps correctly
  • Averages losses over window
  • Tracks previous window average
  • Zero disables messages
  • One emits every step

6. Integration Scenarios

  • Full training loop with string personality
  • Switching personalities mid-training
  • Disabled optimizer produces no messages

Test Results

All 35 tests pass.

Fixes #13

…e_every (fixes smiley-maker#13)

Add new test file with 25 comprehensive tests covering:

1. Registry with Strings:
   - Optimizer accepts string personality names
   - All registered personalities are resolvable
   - Unknown personality strings raise KeyError

2. Registry with Objects:
   - Optimizer accepts function personalities
   - Optimizer accepts class instance personalities
   - Optimizer accepts lambda personalities

3. Adding to Registry:
   - Can register new personalities
   - Can register class-based personalities
   - Cannot overwrite without flag
   - Can overwrite with explicit flag

4. Specific Personality Tests:
   - Wholesome behavior (first step, decrease, increase)
   - Sassy behavior (first step, decrease, increase)
   - QuietPersonality respects interval

5. message_every Smoothing:
   - Counts steps correctly
   - Averages losses over window
   - Tracks previous window average
   - Zero disables messages
   - One emits every step

6. Integration Scenarios:
   - Full training loop with string personality
   - Switching personalities mid-training
   - Disabled optimizer produces no messages

Total tests: 35 passed

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@smiley-maker
Copy link
Owner

Thank you for adding these tests! This is a huge quality-of-life improvement for the project. Strengthening the test coverage at this stage is incredibly valuable, and I really appreciate the care you put into this.

@smiley-maker smiley-maker merged commit d898e5d into smiley-maker:main Dec 15, 2025
0 of 3 checks passed
@majiayu000 majiayu000 deleted the feature/issue-13-more-tests branch December 15, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add more tests

2 participants