Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ed: fix no-match showing multiple error prompts #775

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Oct 30, 2024

  • Delete old code for handling repeated search since getAddr() now supports it
  • edParse() must return true for a valid command, so defer to input() (its caller) to distinguish NoMatch and NoSavedPattern errors
  • getAddr() may be called twice, and NoMatch/NoSavedPattern error could occur either time
  • For "g" command, the NoMatch condition is not an error (no action is performed)
  • Fix an issue with parsing 2 addresses: "2,n" is equivalent to "2n", not "2,$n"
  • test1: "//l" ---> error: no previous pattern
  • test2: ",/main/n" ---> run command n for lines ranging from 1 to the 1st match of /main/
  • test3: "?NO LINE MATCHES THIS!!!?" ---> error: no match
  • test4: "2,n" ---> just line 2
  • test5: ",2n" ---> lines 1 to 2
  • test6: ",n" ---> lines 1 to $Max

* Delete old code for handling repeated search since getAddr() now supports it
* edParse() must return true for a valid command, so defer to input() (its caller) to distinguish NoMatch and NoSavedPattern errors
* getAddr() may be called twice, and NoMatch/NoSavedPattern error could occur either time
* For "g" command, the NoMatch condition is not an error (no action is performed)
* Fix an issue with parsing 2 addresses: "2,n" is equivalent to "2n", not "2,$n"
* test1: "//l" ---> error: no previous pattern
* test2: ",/main/n" ---> run command n for lines ranging from 1 to the 1st match of /main/
* test3: "?NO LINE MATCHES THIS!!!?" ---> error: no match
* test4: "2,n" ---> just line 2
* test5: ",2n" ---> lines 1 to 2
* test6: ",n" ---> lines 1 to $Max
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: ed The ed program labels Oct 30, 2024
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:06 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 30, 2024 14:07 — with GitHub Actions Inactive
@coveralls
Copy link

coveralls commented Oct 30, 2024

Pull Request Test Coverage Report for Build 11606151648

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.7%) to 73.069%

Totals Coverage Status
Change from base Build 11589259185: -0.7%
Covered Lines: 350
Relevant Lines: 479

💛 - Coveralls

bin/ed Outdated
@@ -235,7 +235,13 @@ sub input {
# sanity check addresses
foreach my $ad (@adrs) {
next unless defined $ad;
if ($ad > maxline() || $ad < 0) {
if ($ad == -1) {
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe some constant names for these magic numbers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, added.

@briandfoy briandfoy added the Status: changes requested adjust the pull request as noted in comments label Oct 30, 2024
@briandfoy briandfoy self-assigned this Oct 30, 2024
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos had a problem deploying to automated_testing October 31, 2024 04:33 — with GitHub Actions Failure
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing October 31, 2024 04:33 — with GitHub Actions Inactive
@briandfoy briandfoy merged commit 017a1b6 into briandfoy:master Oct 31, 2024
20 of 22 checks passed
@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever Status: changes requested adjust the pull request as noted in comments labels Oct 31, 2024
@briandfoy briandfoy added Type: bug an existing feature does not work and removed Type: enhancement improve a feature that already exists labels Nov 8, 2024
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: ed The ed program Status: released there is a new release with this fix Type: bug an existing feature does not work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants