Skip to content

Fix Scenario Outline Variables in Array and Named Parameter Variable Wrapped in Invalid Curly Braces#118

Merged
olexale merged 3 commits into
masterfrom
bugfix/scenario_outlines_arrays
Nov 1, 2025
Merged

Fix Scenario Outline Variables in Array and Named Parameter Variable Wrapped in Invalid Curly Braces#118
olexale merged 3 commits into
masterfrom
bugfix/scenario_outlines_arrays

Conversation

@olexale
Copy link
Copy Markdown
Owner

@olexale olexale commented Nov 1, 2025

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.

@olexale olexale requested a review from Copilot November 1, 2025 10:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 _replacePlaceholders to 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.

@olexale olexale merged commit 3d086cd into master Nov 1, 2025
1 check passed
@olexale olexale deleted the bugfix/scenario_outlines_arrays branch November 1, 2025 11:07
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