Skip to content

Add CharacterCombinableArbitrary#3

Open
kail-is wants to merge 12 commits intomainfrom
combinable-arbitrary-char
Open

Add CharacterCombinableArbitrary#3
kail-is wants to merge 12 commits intomainfrom
combinable-arbitrary-char

Conversation

@kail-is
Copy link
Owner

@kail-is kail-is commented Jul 20, 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.

@kail-is kail-is changed the title feat: Add CharacterCombinableArbitrary following IntegerCombinableArb… Add CharacterCombinableArbitrary following IntegerCombinableArb… Jul 20, 2025
@kail-is kail-is force-pushed the combinable-arbitrary-char branch from 0c213a1 to ef139cf Compare August 17, 2025 14:02
@kail-is kail-is force-pushed the combinable-arbitrary-char branch 3 times, most recently from 6fc18b7 to e3e2640 Compare September 6, 2025 09:58
@kail-is kail-is changed the title Add CharacterCombinableArbitrary following IntegerCombinableArb… Add CharacterCombinableArbitrary Sep 6, 2025
@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
@kail-is kail-is force-pushed the combinable-arbitrary-char branch from 756b2f2 to 9ec4346 Compare December 20, 2025 12:31
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
@kail-is kail-is force-pushed the combinable-arbitrary-char branch from 9ec4346 to 3ae125b Compare December 20, 2025 12:35
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