Å×½ºÆ® :: ¾î¼³ ¼Ç

Test :: Assertions ¸ðµâÀº ´ÜÀ§ ¹× ·±Å¸ÀÓ Å×½ºÆ® ¸ðµÎ¸¦À§ÇÑ ºôµù ºí·Ï ¼¼Æ®ÀÔ´Ï´Ù.
Áö±Ý ´Ù¿î·Îµå

Å×½ºÆ® :: ¾î¼³ ¼Ç ¼øÀ§ ¹× ¿ä¾à

±¤°í

  • Rating:
  • ƯÇã:
  • Perl Artistic License
  • °¡°Ý:
  • FREE
  • °Ô½ÃÀÚ À̸§:
  • John Alden
  • °Ô½ÃÀÚ À¥»çÀÌÆ®:
  • http://search.cpan.org/~bbc/Test-Assertions-1.054/lib/Test/Assertions.pm

Å×½ºÆ® :: ¾î¼³ ¼Ç ű×


Å×½ºÆ® :: ¾î¼³ ¼Ç ¼³¸í

Test :: Assertions ModuleÀº ´ÜÀ§ ¹× ·±Å¸ÀÓ Å×½ºÆ®¸¦À§ÇÑ ´Ü¼øÇÑ ºôµù ºí·Ï ¼¼Æ®ÀÔ´Ï´Ù. Test :: Assertions ModuleÀº ´ÜÀ§ ¹× ·±Å¸ÀÓ Å×½ºÆ®¸¦À§ÇÑ ´Ü¼øÇÑ ºôµù ºí·Ï ¼¼Æ®ÀÔ´Ï´Ù .Synopsis #Assert´Â Å×½ºÆ®¸¦ »ç¿ëÇÏÁö ¾Ê½À´Ï´Ù .: ¾î¼³ ¼Ç; #ASSERT °æ°í "¾î¼³ ¼Ç ¿À·ù"... »ç¿ë Å×½ºÆ® :: ¾î¼³ ¼Ç QW (°æ°í); #Assert´Â "¾î¼³ ¼Ç ¿À·ù"·Î Á×½À´Ï´Ù. #ASSERT´Â "¾î¼³ ¼Ç ¿À·ù"... ½ºÅà ÃßÀû »ç¿ë Å×½ºÆ® :: ¾î¼³ ¼Ç QW (cluck); #ASSERT´Â "¾î¼³ ¼Ç ¿À·ù"·Î Á×½À´Ï´Ù ... ½ºÅà ÃßÀû »ç¿ë Å×½ºÆ® :: ¾î¼³ ¼Ç qw (°í¹é); #ASSERT Àμâ OK / NOT OK Å×½ºÆ® »ç¿ë :: ¾î¼³ ¼Ç QW (Å×½ºÆ®); #will ¿øÀÎ ¾î¼³ ¼Ç ¿À·ù ÁÖÀå (1 == 0); #Optional ¸Þ½ÃÁö ÁÖÀå (0 == 1, "Daft"); # CodeRef°¡ ÁÖÀå µÈ °æ¿ì #checks (DIE (SUB {DIE ()}))); # Perl°¡ OK ¾î¼³ ¼Ç (ÄÄÆÄÀÏ ( 'program.pl'))À» ÄÄÆÄÀÏÇÏ´Â °æ¿ì È®ÀÎÇϽʽÿÀ. #deep ºñ±³ Assert (@a, @b), "À§Á¬ ÀÏÄ¡ ¸ñ·Ï"# ¼±ÅÃÀû ¸Þ½ÃÁö°¡ Ç¥½ÃµË´Ï´Ù); ÁÖÀå (µ¿µîÇÑ (% A, % B)); #compare value assert (equals_file ($ foo, 'bar.dat'), "°ª ÀÏÄ¡ °ª °ª"); #compare ÅëÁ¶¸² °ª (ÆÄÀÏ ³»¿ëÀ» Á¤±Ô½ÄÀ¸·Î »ç¿ëÇÏ¿© Á¤±Ô½Ä ÀÏÄ¡) Assert (matches_file ($ foo, 'bar.regex')); #compare ÆÄÀÏ ³»¿ë Assert (files_equal ( 'foo.dat', 'bar.dat')); # Foo :: Bar Tests (3 Å×½ºÆ®ÀÇ ¿À·ù 1 ¿À·ù) '¸¦ À§ÇØ OK (['OK 1 ','OK 2 ','comment ','OK 3 ','OK 3 ','Foo :: Bar Tests) ', 0); # ´Ù¸¥ Å×½ºÆ® ½ºÅ©¸³Æ® ASSIGN_FILE ( "test.pl")ÀÇ Collate °á°ú #file ·çƾ $ success = write_file ( 'bar.dat', 'hello world'); Assert (write_file ( 'bar.dat', 'hello world'), 'ÆÄÀÏÀÌ ÀÛ¼ºµÇ¾ú½À´Ï´Ù'); $ string = read_file ( 'example.out'); Assert (read_file ( 'example.out'), 'ÆÄÀÏÀÌÀÖ´Â ÆÄÀÏ'); ÇïÆÛ ·çƾÀº assert () ³»¿¡¼­ »ç¿ëÇÒ ÇÊ¿ä°¡ ¾ø½À´Ï´Ù. (equals_file ($ string, $ filename)) {print "ÆÄÀÏ hasn ' T´Â º¯°æµÊ - skippingn "; } else {my $ rc = run_complex_process ($ string); Àμâ "ÆÄÀÏ º¯°æ - ¹®ÀÚ¿­Àº '$ rc'n"À¸·Î Àç 󸮵Ǿú½À´Ï´Ù. } ($ boolean, $ Ãâ·Â) = ÄÄÇø®½º ( 'file.pl'); # ¶Ç´Â ... ³» $ ¹®ÀÚ¿­; ($ boolean, $ standard_output) = ÄÄÆÄÀÏ ( 'file.pl', 1, $ string); # $ stringÀº $ standard_outputin Å×½ºÆ® ¸ðµå¿Í º°µµ·Î Ç¥ÁØ ¿À·ù°¡ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù : Å×½ºÆ® :: ¾î¼³ ¼Ç qw (Å×½ºÆ®); °èȹ Å×½ºÆ® => 4; °èȹ Å×½ºÆ®; # ¼ýÀÚ ¸¸ Ãß·ÐÇÏ·Á´Â ½Ãµµ (1,2); #Only º¸°í¼­ È®ÀÎ /ÀÌ Å×½ºÆ®¿¡ ´ëÇØ OK°¡ ¾Æ´Õ´Ï´Ù. 2; #skipÀÌ Å×½ºÆ® #in Å×½ºÆ® / È®ÀÎ ¸ðµå ... Å×½ºÆ® »ç¿ë :: ¾î¼³ ¼Ç QW (TEST / OK); OK (1); #ssert ¿ä±¸ »çÇ׿¡ ´ëÇÑ #synonym : ¡¤ Perl.


Å×½ºÆ® :: ¾î¼³ ¼Ç °ü·Ã ¼ÒÇÁÆ®¿þ¾î