google / google/langextract

Add edge case tests for prompt validation

Open
#316 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
38.6k
Forks
2.7k
Avg merge
3d 15h
Merged PRs (30d)
3

Description

## Problem
The prompt validation test suite lacks coverage for important edge cases that could cause unexpected behavior in production.

## Proposed Solution
Add three new test cases to `tests/prompt_validation_test.py` to improve test coverage:

1. **Empty extraction text** - Verify that empty strings are properly rejected
2. **Unicode and special characters** - Ensure proper handling of café, °F, and other unicode
3. **Very long extraction text** - Test graceful handling of 1000+ character extractions

## Benefits
- Improves reliability by catching edge case bugs early
- Better test coverage for error handling paths
- Documents expected behavior for edge cases

## Implementation
Three new test methods added to `PromptAlignmentValidationTest` class following existing test patterns.

Contributor guide

Open the contributing guide

Research direction

Open tests/prompt_validation_test.py and read the existing PromptAlignmentValidationTest methods and their assertions. Add coverage for empty extraction text, Unicode such as café and °F, and extraction text over 1000 characters, following the established patterns. Run the prompt validation tests; done means all three edge cases have explicit passing assertions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.