Sha256: 2e2f8f6f3a5c306a3e8af31e993d4787455b4dd20b6b92df6add05334c3d8518

Contents?: true

Size: 845 Bytes

Versions: 92

Compression:

Stored size: 845 Bytes

Contents

#!/usr/bin/env bats

@test "zero steps for one" {
  #skip
  run bash collatz_conjecture.sh 1

  [ "$status" -eq 0 ]
  [ "$output" -eq 0 ]
}

@test "divide if even" {
  skip
  run bash collatz_conjecture.sh 16

  [ "$status" -eq 0 ]
  [ "$output" -eq 4 ]
}

@test "even and odd steps" {
  skip
  run bash collatz_conjecture.sh 12

  [ "$status" -eq 0 ]
  [ "$output" -eq 9 ]
}

@test "large number of even and odd steps" {
  skip
  run bash collatz_conjecture.sh 1000000

  [ "$status" -eq 0 ]
  [ "$output" -eq 152 ]
}

@test "zero is an error" {
  skip
  run bash collatz_conjecture.sh 0

  [ "$status" -eq 1 ]
  [ "$output" == "Error: Only positive numbers are allowed" ]
}

@test "negative value is an error" {
  skip
  run bash collatz_conjecture.sh -15

  [ "$status" -eq 1 ]
  [ "$output" == "Error: Only positive numbers are allowed" ]
}

Version data entries

92 entries across 92 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.179 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.178 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.177 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.176 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.175 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.174 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.173 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.172 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.171 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.170 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.169 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.167 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.166 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.165 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.164 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.163 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.162 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.161 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.160 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh