Skip to content

For tests, functions should indicate which version of Bash they work with #19

@housni

Description

@housni

During testing, we need test against various versions of Bash (#18).

Some of Sheldons functions will work on older versions of Bash.
For the tests, we should be able to specify which function can be tested against a particular Bash version so that we can even test on older versions of Bash to show users what functions can be used in which version of Bash.

I'm thinking of something along the lines of a comment at the top of a function like:

.
.
.
## @returns Strings in $2 with the glue string, $1.
## @compatibility 3.2+
################################################################################
Sheldon.Util.String.join() {
  local trim
  .
  .
  .

When running tests:

  1. Docker container, which runs the test, should have an env var indicating Bash version
  2. Parse file and match pattern: ^Sheldon.<camel cap dir name>.<camel cap basename>.+\(\)\s\{$
  3. Read lines above until @compatibility [0-9](\.[0-9]{2}[\+<>=]{2})$ is found
  4. If matched version is equal to or greater than Docker's Bash version, run the test. Else skip while notifying user of incompatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions