Skip to content

Non-executable lines of code marked as executable in coverage report #634

@RevanProdigalKnight

Description

@RevanProdigalKnight
Q A
OS Linux (Cygwin on Windows)
Shell & version bash 5.2.21(1)-release
bashunit version 0.34.1

Summary

Bashunit coverage calculation does not properly ignore all non-executable lines.

Current behavior

The following lines are counted as executable lines of code which should not be:

  • Case statements with a comment afterward (e.g.: *thing) # Looks for thing at end of text) - it looks like the grep pattern for case statements is simply missing a (#.*)? for comments
  • Loop end with file redirection (e.g.: done < /path/to/file, done <<<"$var", etc.)

How to reproduce

See above

Expected behavior

These lines should be omitted from executable lines of code

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions