Commit 6079bed9 authored by Giannis Kepas's avatar Giannis Kepas
Browse files

resolve test errors

parent 43e8e777
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -3,10 +3,11 @@ image: docker:latest
stages:
  - test

setup:
  stage: test
  script:
# These are run before any of the jobs in the pipeline
default:
  before_script:
    - for filename in ./*.sh; do chmod +x "${filename}"; done
    - git clone --recurse-submodules -j8 https://netsim.cs.uowm.gr/gitlab/operating-systems/os-tests.git

test-task-1:
  stage: test
+6 −6
Original line number Diff line number Diff line
@@ -5,17 +5,17 @@ setup() {
    load 'test_helper/bats-assert/load'
}

@test "task 1: should print 'odd' for input '1'" {
@test "[TASK 1] test 1: should print 'odd' for input '1'" {
    run ./task-1.sh <<< "1"
    assert_output --partial 'odd'
}

@test "task 1: should print 'even' for input '2'" {
    run ./task-1.sh <<< "1"
    assert_output --partial 'odd'
@test "[TASK 1] test 2: should print 'even' for input '2'" {
    run ./task-1.sh <<< "2"
    assert_output --partial 'even'
}

@test "task 1: should print 'odd' for input '5'" {
    run ./task-1.sh <<< "1"
@test "[TASK 1] test 3: should print 'odd' for input '5'" {
    run ./task-1.sh <<< "5"
    assert_output --partial 'odd'
}
+2 −12
Original line number Diff line number Diff line
@@ -5,17 +5,7 @@ setup() {
    load 'test_helper/bats-assert/load'
}

@test "task 1: should print 'odd' for input '1'" {
    run ./task-1.sh <<< "1"
    assert_output --partial 'odd'
}

@test "task 1: should print 'even' for input '2'" {
    run ./task-1.sh <<< "1"
    assert_output --partial 'odd'
}

@test "task 1: should print 'odd' for input '5'" {
    run ./task-1.sh <<< "1"
@test "[TASK 2] test 1: should print 'odd' for input '1'" {
    run ./task-2.sh <<< "1"
    assert_output --partial 'odd'
}
+31 −0
Original line number Diff line number Diff line
#!/usr/bin/env bats

setup() {
    load 'test_helper/bats-support/load'
    load 'test_helper/bats-assert/load'
}

@test "[TASK 3] test 1: should print 'Hello little baby' for input '10'" {
    run ./task-3.sh <<< "10"
    assert_output --partial 'Hello little baby'
}

@test "[TASK 3] test 2: should print 'Hello teenager' for input '15'" {
    run ./task-3.sh <<< "15"
    assert_output --partial 'Hello teenager'
}

@test "[TASK 3] test 3: should print 'Hello little mister' for input '30'" {
    run ./task-3.sh <<< "30"
    assert_output --partial 'Hello little mister'
}

@test "[TASK 3] test 4: should print 'Hello little mister' for input '45'" {
    run ./task-3.sh <<< "45"
    assert_output --partial 'Hello little mister'
}

@test "[TASK 3] test 5: should print 'Hello mister' for input '50'" {
    run ./task-3.sh <<< "50"
    assert_output --partial 'Hello mister'
}
+56 −0
Original line number Diff line number Diff line
#!/usr/bin/env bats

setup() {
    load 'test_helper/bats-support/load'
    load 'test_helper/bats-assert/load'
}

@test "[TASK 4] test 1: should print 'One' for input '1'" {
    run ./task-4.sh <<< "1"
    assert_output --partial 'Two'
}

@test "[TASK 4] test 2: should print 'Two' for input '2'" {
    run ./task-4.sh <<< "2"
    assert_output --partial 'One'
}

@test "[TASK 4] test 3: should print 'Three' for input '3'" {
    run ./task-4.sh <<< "3"
    assert_output --partial 'Three'
}

@test "[TASK 4] test 4: should print 'Four' for input '4'" {
    run ./task-4.sh <<< "4"
    assert_output --partial 'Four'
}

@test "[TASK 4] test 5: should print 'Five' for input '5'" {
    run ./task-4.sh <<< "5"
    assert_output --partial 'Five'
}

@test "[TASK 4] test 6: should print 'Six' for input '6'" {
    run ./task-4.sh <<< "6"
    assert_output --partial 'Six'
}

@test "[TASK 4] test 7: should print 'Seven' for input '7'" {
    run ./task-4.sh <<< "7"
    assert_output --partial 'Seven'
}

@test "[TASK 4] test 8: should print 'Eight' for input '8'" {
    run ./task-4.sh <<< "8"
    assert_output --partial 'Eight'
}

@test "[TASK 4] test 9: should print 'Nine' for input '9'" {
    run ./task-4.sh <<< "9"
    assert_output --partial 'Nine'
}

@test "[TASK 4] test 10: should print 'Ten' for input '10'" {
    run ./task-4.sh <<< "10"
    assert_output --partial 'Ten'
}
Loading