Changes between Version 1 and Version 2 of PerlSixTesting
- Timestamp:
- 12/09/08 21:47:01 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PerlSixTesting
v1 v2 16 16 17 17 === adverb on operators === 18 19 {{{ 18 20 $x eq 'foo' :ok('Test descriptions'); 19 21 $x == 23 :ok('explicit numeric test'); 20 22 ?$x :ok<stuff> # used to be ok($x, 'stuff'); 21 23 try { dispatch() } :ok<...> # used to be lives_Ok { ... }, '...'; 22 (it was also proposed to name it :test instead of :ok) 23 pros: 24 }}} 25 26 (it was also proposed to name it `:test` instead of `:ok`) 27 28 '''pros:''' 24 29 * good diagnose of output 25 30 * force exact comparison semantics 26 31 * no pollution of namespace 27 cons:32 '''cons:''' 28 33 * have to auto-generate ops with adverbs 29 34 * more complicated grammar needed … … 32 37 33 38 === normal sub calls, like now === 39 {{{ 34 40 ok $x eq 'foo', 'description'; 35 41 dies_ok { ... }, 'description'; 36 pros: 42 }}} 43 44 '''pros:''' 37 45 * easier to implement 38 46 * it's been proven to work out well 39 47 * visually tests are very easy to spot 40 cons:48 '''cons:''' 41 49 * it's *very* hard to get good diagnostics out of failed tests 42 50 (advanced macro fiddling needed)