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.66 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.65 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.64 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.63 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.62 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.61 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.60 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.59 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.58 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.57 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.56 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.55 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.54 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.53 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.52 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.51 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.50 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.49 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.48 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh
trackler-2.2.1.47 tracks/bash/exercises/difference-of-squares/difference_of_squares_test.sh