mirror of
https://github.com/open-thought/reasoning-gym.git
synced 2026-04-23 16:55:05 +00:00
adds zebrapuzzles
This commit is contained in:
parent
5d84b6bec5
commit
0c9094e9f4
20 changed files with 2447 additions and 2 deletions
20
tests/test_zebra.py
Normal file
20
tests/test_zebra.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import pytest
|
||||
|
||||
from reasoning_gym.logic.zebra_puzzles import ZebraConfig, ZebraDataset
|
||||
|
||||
|
||||
def test_zebra_puzzles():
|
||||
"""Test basic properties and solution of generated items"""
|
||||
|
||||
config = ZebraConfig(seed=42, size=10, k=4, m=4)
|
||||
dataset = ZebraDataset(config)
|
||||
|
||||
for item in dataset:
|
||||
assert isinstance(item, dict)
|
||||
assert "question" in item
|
||||
assert "answer" in item
|
||||
assert "metadata" in item
|
||||
|
||||
# Test the scoring
|
||||
assert dataset.score_answer(answer=item["answer"], entry=item) == 1.0
|
||||
assert dataset.score_answer(answer=None, entry=item) == 0.0
|
||||
Loading…
Add table
Add a link
Reference in a new issue