Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

IFS broken after first run #89

@Sylvain303

Description

@Sylvain303

Here follows a bats that fails. First run passes,not the second.

loop_func() {
  local search="none one two tree"
  local d

  for d in $search ; do
    echo $d
  done
}

@test "loop_func" {
  run loop_func
  [[ "${lines[3]}" == 'tree' ]]
  run loop_func
  [[ "${lines[2]}" == 'two' ]]
}

outputs:

bats loop.bats 
 ✗ loop_func
   (in test file loop.bats, line 14)
     `[[ "${lines[2]}" == 'two' ]]' failed

1 test, 1 failure

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