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.

@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
Copy link
Contributor

@seongahjo seongahjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@seongahjo seongahjo merged commit 9667086 into naver:main Dec 31, 2025
10 checks passed
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.

2 participants