单元测试期望互动

时间:2014-11-26 19:30:29

标签: unit-testing tcl expect

是否有预期的单元测试框架? 具体来说,我如何在下面的proc中单元测试交互?

proc take_device_offline {device_name} {
    global device_prompt

    send "device offline $device_name"
    expect {
        -re "offline?" {
            send y
            expect $device_prompt
        }
        -re "something else" {
            expect $device_prompt
        }
    }
}

0 个答案:

没有答案