å祥寺.pmã¯ä¸å¿ï¼ï¼ï¼Perlã®ã¤ãã³ããªã®ã§ããã¾ã«ã¯Perlã®ãã¨ãæ¸ãã¦ã¿ã¾ãã
Test2ã¢ã¸ã¥ã¼ã«
Perlã®ãã¹ãã£ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã¨è¨ãã°Test::More
ãã¹ã¿ã³ãã¼ãã§ãããä»ãªãªã¼ã¹ããã¦ããTest::More v1.3
以éã§ã¯å
é¨æ§é ãå
¨ã¦ä½ãç´ããã¦ãã¦ãTest2
ã¨ããã¢ã¸ã¥ã¼ã«ããã¼ã¹ã«ãªã£ã¦ãã¾ãã
Test2
ã¢ã¸ã¥ã¼ã«ã§ã¯ããã¹ãã®çµæãã¡ãã»ã¼ã¸ãå
¨ã¦ãã¤ãã³ããã¨ããå½¢ã§åãåºããããã«ãªã£ã¦ãã¦ããã¹ãã¢ã¸ã¥ã¼ã«ã®ä½è
ã¯å¾æ¥ãã確å®ã«ãã¹ããã§ããããã«ãªã£ã¦ãã¾ãã
詳細ã¯å²æãã¾ãããå¾æ¥ã®Test::More
ã§ã¯ãã¹ãã¢ã¸ã¥ã¼ã«ã®ãã¹ããé£ãããã¨ãã課é¡ã解決ããããã«Test2
ã¢ã¸ã¥ã¼ã«ã¯ä½ããã¾ããã
Test2::Suiteã¢ã¸ã¥ã¼ã«
ãã¦ãTest::More
ã®ä¸èº«ã¯Test2
ã¢ã¸ã¥ã¼ã«ã使ã£ã¦æ¸ãç´ããã¦ãã¾ãããå¾æ¹äºææ§ãç¶æããããåã«Test::More
ã使ãã ãã§ããã°ããã¹ãã®æ¸ãæ¹ã¯å¾æ¥ã¨ã¾ã£ããå¤ããã¾ããããããªããTest2
ã¢ã¸ã¥ã¼ã«ããã¼ã¹ã«ããTest2::Suite
ã¨ããã¢ã¸ã¥ã¼ã«ã使ãã¨ãä»ã¾ã§ãããã¹ããæ¸ãä¸ã§ä¾¿å©ãªæ©è½ã使ããããã«ãªãã¾ãã
ä¾ãã°Test2::Bundle::More
ã使ãã°ããã詳細ãªã¡ãã»ã¼ã¸ãåºåããis_deeply
ã使ãã¾ãããTest2::Plugin::UTF8
ã¨ãããã©ã°ã¤ã³ã使ãã°ãUnicodeæååãæ£ãã表示ãããããã«ãªãã¾ãã
use Test2::Bundle::More; use Test2::Plugin::UTF8; use utf8; my $hash1 = { name => "ã¬ã³ãã«ã" }; is_deeply($hash1, { name => "ãµã«ãã³"}, "ã¤ã¹ã¿ã«ã®åå"); done_testing;
å®è¡ããã¨ï¼å½ç¶ããã·ã¥ã®ä¸èº«ã¯ä¸è´ããªãã®ã§ï¼ãã¹ãã失æãããã®è©³ç´°ãªã¡ãã»ã¼ã¸ã表示ããã¾ãã
$ perl test.t not ok 1 - ã¤ã¹ã¿ã«ã®åå # Failed test 'ã¤ã¹ã¿ã«ã®åå' # at test.t line 8. # +--------+------------+----+----------+ # | PATH | GOT | OP | CHECK | # +--------+------------+----+----------+ # | {name} | ã¬ã³ãã«ã | eq | ãµã«ãã³ | # +--------+------------+----+----------+ 1..1
Test::More
ã®is_deeply
ããèªã¿ãããå½¢å¼ã§åºåããã¾ãããã¾ãæ¥æ¬èªãåºåãã¦ããããªãã¿ã®Wide Character...
ã®ã¡ãã»ã¼ã¸ãåºåããã¦ãã¾ããã
ãªããUnicodeæååã表示ããéã«ã¯ãUnicode::GCString
ã¢ã¸ã¥ã¼ã«ãã¤ã³ã¹ãã¼ã«ããã¦ããªãã¨ãæ£ããæåå¹
ã§è¡¨ç¤ºã§ããªãæ¨ã®è¦åã¡ãã»ã¼ã¸ã表示ãããã®ã§ãä½µãã¦ã¤ã³ã¹ãã¼ã«ãã¦ãããæ¹ãè¯ãããã§ãã
ãããã«
ãã®ããã«Test2::Suite
ã使ããã¨ã§Test::More
ããåããããããã¹ããæ¸ããããã«ãªãã¾ãããã²ä½¿ã£ã¦ã¿ã¦ãã ããã
ãããã Perl (ããã°ã©ãã³ã°ã®æç§æ¸)
- ä½è : 深沢åå°
- åºç社/ã¡ã¼ã«ã¼: æè¡è©è«ç¤¾
- çºå£²æ¥: 2016/01/16
- ã¡ãã£ã¢: åè¡æ¬ï¼ã½ããã«ãã¼ï¼
- ãã®ååãå«ãããã°ãè¦ã