Skip to content
Snippets Groups Projects
Select Git revision
  • 7f9670425324dc4a28c6396e5228d8cd78b25b43
  • master default
2 results

generateSteiner.py

Blame
  • assignment_tests.sh 1.08 KiB
    #!/usr/bin/env bats
    
    ############################ DO NOT EDIT THIS FILE #####################################
    # File: assignement_tests.sh
    # 
    # DO NOT EDIT THIS FILE
    #
    # Add/Edit Student tests in student_tests.sh
    # 
    # All tests in this file must pass - it is used as part of grading!
    ########################################################################################
    
    @test "Pipes" {
        run "./dsh" <<EOF                
    ls | grep dshlib.c
    EOF
    
        # Strip all whitespace (spaces, tabs, newlines) from the output
        stripped_output=$(echo "$output" | tr -d '[:space:]')
    
        # Expected output with all whitespace removed for easier matching
        expected_output="dshlib.clocalmodedsh4>dsh4>cmdloopreturned0"
    
        # These echo commands will help with debugging and will only print
        #if the test fails
        echo "Captured stdout:" 
        echo "Output: $output"
        echo "Exit Status: $status"
        echo "${stripped_output} -> ${expected_output}"
    
        # Check exact match
        [ "$stripped_output" = "$expected_output" ]
    
        # Assertions
        [ "$status" -eq 0 ]
    }