Skip to Main Content
Mathematica 錦囊妙計
book

Mathematica 錦囊妙計

by Sal Mangano
April 2014
Beginner to intermediate content levelBeginner to intermediate
830 pages
15h 21m
Chinese
GoTop Information, Inc.
Content preview from Mathematica 錦囊妙計
19.11 將 Wolfram Workbench MUnit 套件整合至前端介面
|
769
以下是使用驅動器的基本使用範例,我故意使用錯誤的預期結果使得
ID2
ID4
的測試
失敗。[Page-771]
討論說明
以上所使用的驅動器因過於簡陋而無法支援 Workbench 的單元測試功能,如果你有雄
心壯志的話,甚至可以設計比 Workbench 更強大的除錯器,完全依你的需求而定,最
重要是要先熟悉
MUnit
應用程式介面(Application Program InterfaceAPI)的用法,
雖然
MUnit
套件的說明文件很簡略,但此套件的程式碼設計得十分容易使用。例如,
執行
?"MUnit`*"
可列出套件中所有的公開函式,為了節省文字空間,以下只列出
T
頭的指令,點 選輸出項 目即可看到 該指令或 項的用途,而 最重要的 令是選擇
selector),例如
TestID
等,因為這用來擷取
TestResultObject
的內部資訊,這個物
件是由
Test
TestMatch
等測試指令所輸出。
ch19.indd 769 2014/4/2 下午 05:10:52
770
|
第十九章
檢視一下
MUnit
套件中的指令,使我激發起建立測試群組的想法,如同訣竅 19.10
述,
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Ubuntu for Non-Geeks, 4th Edition

Ubuntu for Non-Geeks, 4th Edition

Rickford Grant, Phil Bull

Publisher Resources

ISBN: 9789863470106