具體的格式串信息,請參考:http://qa.php.net/phpt_details.php#expectf_section.
3. 正則表達式標簽:expectx
1
2
3
4
|
<<<TC title: with regular rules. expectx: hello world [0-9]*. TC; |
4. 多行匹配
1
2
3
4
5
6
7
8
9
|
<<<TC title: with multi lines. expect:| 2 3 TC; echo 1 + 1 . "\n" ; echo 1 + 2 . "\n" ; |
5. 將預期放在文件中
如果預期內容很多的話,可以將預期內容放在一個隱藏文件中,以.開頭,然后和腳本同名,后綴是et或者ex,如果是正則表達式的話是,以ex結尾,其他的以et結尾。
比如腳本05_expect_file.php,里面的預期標簽是expect,它對應的預期文件是.05_expect_file.et
腳本06_expectx_file.php預期標簽是expectx,它對應的預期文件是.06_expectx_file.ex
原文轉自:http://www.zentao.net/article-view-79773.html