Skip to content

Conversation

@kail-is
Copy link
Contributor

@kail-is kail-is commented Sep 7, 2025

Summary

Add CharacterCombinableArbitrary for customizable Character value generation following existing CombinableArbitrary pattern with Character-specific enhancements.

Description

Implemented CharacterCombinableArbitrary to provide easy customization of Character value generation, addressing the lack of character-specific constraints in current API.

Added components:

  • CharacterCombinableArbitrary interface with standard constraint methods
  • CharacterCombinableArbitraryDelegator for filter/null injection operations
  • JqwikCharacterCombinableArbitrary implementation
  • Factory method CombinableArbitrary.chars()

Key features:

  • Standard character constraints: .alphabetic(), .numeric(), .alphaNumeric(), .withRange(char, char)
  • Character-specific methods:
    • .uppercase() - generates values A-Z for uppercase representation
    • .lowercase() - generates values a-z for lowercase representation
    • .ascii() - generates ASCII printable characters
    • .korean() - generates values 가-힣 for Korean representation
    • .emoji() - generates emoji characters
    • .whitespace() - generates whitespace characters
  • Last-method-wins behavior for constraint precedence
  • Full integration with existing filter/map/unique operations

Usage example:

Character alphaChar = CombinableArbitrary.chars().alphabetic().combined();
Character upperChar = CombinableArbitrary.chars().uppercase().combined();
Character rangeChar = CombinableArbitrary.chars().withRange('A', 'Z').lowercase().combined();
Character koreanChar = CombinableArbitrary.chars().korean().combined();
Character emojiChar = CombinableArbitrary.chars().emoji().combined();

How Has This Been Tested?

Added comprehensive test suite in CharacterCombinableArbitraryTest:

  • Basic constraint validation (alphabetic, numeric, alphaNumeric, uppercase, lowercase, ascii, korean, emoji, whitespace)
  • Range constraint testing with various boundaries
  • Method chaining and last-method-wins precedence verification
  • Integration with filter, map, injectNull, unique operations
  • Complex constraint combinations and character set validation

Is the Document updated?

Documentation will be updated to include CharacterCombinableArbitrary usage examples alongside existing numeric arbitrary types.

- Update @API annotation version to match CharacterCombinableArbitrary interface
- Use Character.isWhitespace() for accurate whitespace validation
- Convert Korean comments to English
- Remove punctuation(), digit(), control(), unicodeCategory() methods
@kail-is kail-is force-pushed the combinable-arbitrary-char branch 2 times, most recently from b5b89ed to 4425639 Compare November 22, 2025 15:19
Replace boolean + allMatch patterns with direct value assertions for clearer test intent:
- alphabetic, numeric, alphaNumeric tests
- ascii, uppercase, lowercase, korean, emoji, whitespace tests
- last method wins tests for better conflict resolution verification

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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.

1 participant