Fix Scenario Outline Variables in Array and Named Parameter Variable Wrapped in Invalid Curly Braces#118
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR enhances scenario outline placeholder handling to support context-aware replacement based on whether placeholders appear inside or outside parameter blocks (braces). The implementation adds comprehensive test coverage for edge cases including nested braces, special characters, and unicode support.
- Refactored
_replacePlaceholdersto use a new context-aware algorithm that tracks brace depth - Added 11 new test cases covering various placeholder scenarios including arrays, named parameters, nested structures, and special characters
- Removed unused import and replaced a custom headers test with more comprehensive feature tests
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/src/scenario_generator.dart | Implemented context-aware placeholder replacement using brace depth tracking to differentiate between placeholders inside and outside parameter blocks |
| test/scenario_outline_test.dart | Added extensive test coverage for scenario outline variable handling including edge cases with arrays, named parameters, nested braces, unicode, and special characters |
| test/feature_test.dart | Removed unused import and replaced custom headers test with new tests for special characters, long step descriptions, and multiple scenarios |
| test/data_tables_test.dart | Added tests for edge cases in data tables including single-row tables, special characters, and unicode content |
Comments suppressed due to low confidence (1)
lib/src/scenario_generator.dart:1
- The generated code
operator: <is invalid Dart syntax. A standalone<operator cannot be used as a named parameter value. This test expects invalid Dart code to be generated, which suggests the placeholder replacement logic may not handle non-placeholder angle brackets correctly when they appear inside parameter blocks.
import 'package:bdd_widget_test/src/bdd_line.dart';
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request enhances the scenario and feature file generation logic and expands test coverage for edge cases in feature parsing. The main changes include a more context-aware placeholder replacement function, additional tests for data tables with special characters and unicode, and improved handling of feature/scenario names with special characters and long descriptions.