Unit testing for shell scripts

前端 未结 6 546
暖寄归人
暖寄归人 2020-12-04 06:17

Pretty much every product I\'ve worked on over the years has involved some level of shell scripts (or batch files, PowerShell etc. on Windows). Even though we wrote the bul

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 06:57

    You should try out the assert.sh lib, very handy, easy to use

    local expected actual
    expected="Hello"
    actual="World!"
    assert_eq "$expected" "$actual" "not equivalent!"
    # => x Hello == World :: not equivalent! 
    

提交回复
热议问题