mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-26 17:13:17 +00:00
test: Add isalpha check for case transformation tests
This commit is contained in:
parent
2593699080
commit
ee67374aae
1 changed files with 4 additions and 2 deletions
|
|
@ -44,14 +44,16 @@ def test_word_sorting_transformations():
|
|||
dataset = WordSortingDataset(config)
|
||||
for item in dataset:
|
||||
for word in item["metadata"]["transformed_words"]:
|
||||
assert word.islower()
|
||||
if word.isalpha(): # Only test alphabetic strings
|
||||
assert word.islower()
|
||||
|
||||
# Test UPPERCASE
|
||||
config = WordSortingConfig(transformation=TextTransformation.UPPERCASE, seed=seed, size=size)
|
||||
dataset = WordSortingDataset(config)
|
||||
for item in dataset:
|
||||
for word in item["metadata"]["transformed_words"]:
|
||||
assert word.isupper()
|
||||
if word.isalpha(): # Only test alphabetic strings
|
||||
assert word.isupper()
|
||||
|
||||
# Test ORIGINAL
|
||||
config = WordSortingConfig(transformation=TextTransformation.ORIGINAL, seed=seed, size=size)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue