Skip to content

Conversation

@UdeshyaDhungana
Copy link
Contributor

@UdeshyaDhungana UdeshyaDhungana commented Nov 21, 2025

  • Add tests for Grep/Multiple Matches Extension

Note

Adds Multiple Matches (-o) test suite and integrates new stages (cj0, ss2, bo4) into tester, course config, and Makefile.

  • Tests (Multiple Matches):
    • Add testMultipleMatchesSingleMatch, testMultipleMatchesSingleLine, testMultipleMatchesMultipleLines in internal/ to validate -o -E output across single/multi-line inputs.
  • Test harness:
    • Introduce PrintMatchesOnlyTestCase and PrintMatchesOnlyTestCaseCollection in internal/test_cases/print_matches_only_test_case.go to emulate grep -o -E, assert exit codes, and verify ordered match outputs.
  • Tester wiring:
    • Register stages cj0, ss2, bo4 in internal/tester_definition.go (with timeout for cj0).
  • Course config:
    • Add new extension multiple-matches with stages cj0, ss2, bo4 to internal/test_helpers/course_definition.yml and descriptions.
  • Makefile:
    • Add test_multiple_matches_with_grep target and include it in test_all.

Written by Cursor Bugbot for commit 267b8db. This will update automatically on new commits. Configure here.

@UdeshyaDhungana UdeshyaDhungana changed the title Add tests for grep/multiple matches Add tests for grep/multiple matches Nov 21, 2025
@UdeshyaDhungana UdeshyaDhungana changed the title Add tests for grep/multiple matches Add tests for Multiple Matches Nov 21, 2025
logger := stageHarness.Logger
executable := stageHarness.Executable

executable.TimeoutInMilliseconds = 1000 * 3600
Copy link
Member

Choose a reason for hiding this comment

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

A whole 60 seconds? That's kinda wild - is there a reason we need to change this from the default @UdeshyaDhungana?

Along the way, you'll learn about extracting matched lines, formatting output, and managing line-by-line processing.
- slug: "multiple-matches"
Copy link
Member

Choose a reason for hiding this comment

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

Can be done in the challenge PR but noting here: let's order extensions like this:

  • Printing matches
  • Multiple matches
  • Highlighting
  • File search
  • Quantifiers
  • Backreferences

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.

3 participants