Note the example of a unit test convenience eunit later reference.

2010-06-19  来源:本站原创  分类:Tech  人气:168 

-module(basic).
-export([basic/1]).
-ifdef(TEST).
%%-define(NOTEST,true).
-include_lib("eunit/include/eunit.hrl").
basic_test_() ->
        fun() -> ?assert(1+1 =:= 2) end.

simple_test() ->
        ?debugHere,
        ?debugMsg(lxw),
        ?debugFmt("sf~n~pdsf",[lxwsss]),
        ?debugVal(basic(1111)),
        ?debugTime(timelxw,basic(22222)),
        [?_assert(1+1 =:= 2 ),
        ?_assert(1+1 =:= 3 )].

assert_equal_test() ->
        ?assertEqual("b" ++ "a",lists:reverse("ab")).
-endif.
basic(N) ->
        ?debugHere,
        io:format("~nN=~p",[N]),
        N.

Note: erlc-DTEST basic.erl-DTEST compiled on behalf of the corresponding parameter is DNOTTEST parameters and with-ifdef (TEST). Correspond

Why did not suggest the above sentence wrong [? _assert (1 +1 =: = 2),? _assert (1 +1 =: = 3)].

相关文章
  • Note the example of a unit test convenience eunit later reference. 2010-06-19

    -module(basic). -export([basic/1]). -ifdef(TEST). %%-define(NOTEST,true). -include_lib("eunit/include/eunit.hrl"). basic_test_() -> fun() -> ?assert(1+1 =:= 2) end. simple_test() -> ?debugHere, ?debugMsg(lxw), ?debugFmt("sf~n~pdsf&

  • Simple unit test summary 2008-09-22

    Last weekend opened a discussion on unit testing. Summarized below: The purpose of unit testing: Ensure that the quality of the code To ensure the maintainability of the code Ensure the scalability of the code Unit testing can help us to do: Improve

  • An Introduction to LDAP 2010-04-13

    An Introduction to LDAP Michael Donnelly If you work in the computing industry, the chances are good that you've heard of LDAP by now. Wondering what all the excitement is about? Want to know a little more about the underlying technology? You've come

  • NAnt Getting Started Guide 2010-08-07

    NAnt Getting Started Guide One. Introduction In the Visual Studio.NET , We'll just use a simple menu command, you can construct and compile a large number of sub-project contains ( For example, inter-related Web Page collection. Executable file .DLL

  • An Introduction to LDAP (rpm) 2011-06-28

    If you work in the computing industry, the chances are good that you've heard of LDAP by now. Wondering what all the excitement is about? Want to know a little more about the underlying technology? You've come to the right place. This introduction -

  • 邮件协议rfc822文档 2013-08-12

    最近项目要解析eml文件,所以收藏以便以后查看 RFC # 822 Obsoletes: RFC #733 (NIC #41952) RFC822: Standard for ARPA Internet Text Messages Revised by David H. Crocker Dept. of Electrical Engineering University of Delaware, Newark, DE 19711 Network: DCrocker @ UDel-Relay Pa

  • the use of jprofile 2009-09-29

    Carried over the Internet 1, Abstract To improve the performance of Java server need to simulate the load of the server. Create a simulation environment, collecting data and the results of the analysis may be the developers of many challenges. The ar

  • [Switch to retain] jQuery selector Choose dom element 2009-03-24

    dom element jQuery selector options This article was originally published in my personal blog http://www.lovestblog.cn/, welcome to visit. (Reprinted please do not delete the line, thank cooperation) jQuery selector is a more confusing in some places

  • Portal Theme Deployment 2008-09-19

    The deployment of custom themes and appearance http://publib.boulder.ibm.com/infocenter/wpdoc/v6r0/index.jsp?topic=/com.ibm.wp.exp.doc/wps/dgn_dpycst.html Because the theme and appearance of JSP as the primary IBM ® WebSphere ® Portal Express enterpr

  • [Switch to reservations] jQuery selector to select dom element 2010-03-06

    jQuery selector to select dom element This article was originally published on my personal blog http://www.lovestblog.cn/, welcome to visit. (Please do not delete the reproduced line, thank you) jQuery selector is a relatively obscure in some places,

  • [Change] batch programming syntax 2010-04-30

    Batch file is a series of commands in sequence to a set of executable text file, the extension BAT. 1, REM REM is a comment command is generally used to add annotations to the program, the contents of the command when the program execution and implem

  • Rails way --->< The Rails Way> extract (6) using ActiveRecord 2010-06-01

    1. When you Zai Xia Run Rails development mode server O'clock, Web browsing device right through the data Biao Li Ji Jie Gou's change will come out in the ActiveRecord object Zhong Fan Ying. However, if you run Zhao Rails of Kong Zhitai, Name changes

  • Rails way --->< The Rails Way> excerpt (6) using ActiveRecord 2010-06-01

    1. When you Zai Xia Run Rails development mode server O'clock, Web browsing device right through the data Biao Li Ji Jie Gou's change will come out in the ActiveRecord object Zhong Fan Ying. However, if you run Zhao Rails of Kong Zhitai, Name changes

  • Rails way --->< The Rails Way> extract (six) using ActiveRecord 2010-06-01

    1. When you Zai Xia Run Rails development mode server O'clock, Web browsing device right through the data Biao Li Ji Jie Gou's change will come out in the ActiveRecord object Zhong Fan Ying. However, if you run Zhao Rails of Kong Zhitai, Name changes

  • oracle10g regular expression 2010-06-09

    The basic examples of regular expressions Before using this new feature, you need to understand the meaning of metacharacters. Full stop (.) Matching a regular expression of any character (except newline). For example, the regular expression matching

  • developerWorks Book Channel: C + + application performance optimization, Chapter 6: Memory pool 2010-08-06

    Introduction This book is for C + + program performance optimization, in-depth C + + program performance optimization methods and examples. The book by the four papers formed the first one introduced C + + language, object model, the article is to op

  • bat syntax of the command [Reserved] 2010-08-31

    How to create a batch file? Do not feel listened to the batch file on the air, in fact something very simple. You have not used Notepad? Used? All right. Notepad will open, what do not have to write, and then select File, Save. Save as type select al

  • Java syntax is based 2010-09-10

    Note that programmers used to mark, indicating the program. Compiler ignores the contents of the Notes, comments, content will not have any impact on the operation procedures. Java language allows three styles of comments: / / Single line comment: Us

  • (To) the use of asynchronous I / O greatly improve application performance 2010-10-06

    Reprinted from: http://www.ibm.com/developerworks/cn/linux/l-async/index.html (Io several very good pictures, worthy of collection) September 28, 2006 Linux ®, the most commonly used input / output (I / O) model is a synchronous I / O. In this model,

  • C + + (very good thing) 2010-11-11

    1. Seeking the return value of the following (Microsoft) int func (x) { int countx = 0; while (x) { countx + +; x = x & (x-1); } return countx; } Assuming x = 9999. Answer: 8 Ideas: the x into the 2-band, to see with the number 1. 2. What is a "r