Sha256: 492123283b1334802ca9fbe6b24a024b3c29ade6d5dd32f367d41480fa6a9020

Contents?: true

Size: 1.22 KB

Versions: 95

Compression:

Stored size: 1.22 KB

Contents

#!/usr/bin/env bats

@test 'difference of squares 1' {
    run bash difference_of_squares.sh 1

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

@test 'difference of squares 5' {
    run bash difference_of_squares.sh 5

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

@test 'difference of squares 100' {
    run bash difference_of_squares.sh 100

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

# Bonus!  Add flags for individual functions
@test 'square of sum 1' {
    skip
    run bash difference_of_squares.sh 1 -S

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

@test 'square of sum 5' {
    skip
    run bash difference_of_squares.sh 5 -S

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

@test 'square of sum 100' {
    skip
    run bash difference_of_squares.sh 100 -S

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

@test 'sum of squares 1' {
    skip
    run bash difference_of_squares.sh 1 -s

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

@test 'sum of squares 5' {
    skip
    run bash difference_of_squares.sh 5 -s

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

@test 'sum of squares 100' {
    skip
    run bash difference_of_squares.sh 100 -s

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

Version data entries

95 entries across 95 versions & 1 rubygems

Version Path
trackler-2.2.1.46 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.45 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.44 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.43 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.42 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.41 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.40 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.39 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.38 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.37 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.36 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.35 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.34 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.33 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.32 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.31 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.30 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.29 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.28 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.27 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh