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.119 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.118 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.117 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.116 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.115 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.114 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.113 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.111 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.110 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.109 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.108 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.107 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.106 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.105 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.104 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.103 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.102 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.101 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.100 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh
trackler-2.2.1.99 tracks/bash/exercises/collatz-conjecture/collatz_conjecture_test.sh