diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 3a3ecaeceb..b6aec943a8 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -10,6 +10,24 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2012-11-27 00:36 UTC+0100 Viktor Szakats (harbour syenar.net) + * contrib/hbct/tests/test.prg + ! fixed one expected test result + ! fixed one wrong test call + ; TOFIX (pbly result of different sting algorythm): + ! MAIN(136) CharSort( "b1a4a3a2a1", 2, 1 ) + Result: "a4a3a2a1b1" + Expected: "a2a1a3a4b1" + + * contrib/hbmisc/doc/en/ht_str.txt + * contrib/hbmisc/tests/tsstrfmt.prg + + moved tests to test code. old test code + converted to regression tests. + + * doc/class_tp.txt + * doc/hdr_tpl.txt + - deleted $TESTS$ sections from templates + 2012-11-27 00:15 UTC+0100 Viktor Szakats (harbour syenar.net) + contrib/hbct/tests/test.prg * contrib/hbct/doc/en/*.txt diff --git a/harbour/contrib/hbct/tests/test.prg b/harbour/contrib/hbct/tests/test.prg index b7a188b933..0a84736048 100644 --- a/harbour/contrib/hbct/tests/test.prg +++ b/harbour/contrib/hbct/tests/test.prg @@ -137,7 +137,7 @@ PROCEDURE Main() HBTEST CharSort( "XXXqwert", 1, 1, 3 ) IS "XXXeqrtw" HBTEST CharSort( "b1a4a3a2a1", 2, 1, 0, 1 ) IS "a1b1a2a3a4" HBTEST CharSort( "384172852", 1, 1, 0, 0, 4 ) IS "134872852" - HBTEST CharSort( "qwert", .T. ) IS "wtrqe" + HBTEST CharSort( "qwert",,,,,, .T. ) IS "wtrqe" HBTEST CharSwap( "0123456789" ) IS "1032547698" HBTEST CharSwap( "ABCDEFGHIJK" ) IS "BADCFEHGJIK" @@ -171,7 +171,7 @@ PROCEDURE Main() HBTEST Round( Celsius( 32.0 ), 1 ) IS 0.0 HBTEST Round( Celsius( 212.0 ), 1 ) IS 100.0 HBTEST Round( Fahrenheit( 0.0 ), 1 ) IS 32.0 - HBTEST Round( Celsius( 100.0 ), 1 ) IS 212.0 + HBTEST Round( Celsius( 100.0 ), 2 ) IS 37.78 HBTEST RangeRem( "0", "9", "year2002.dbf" ) IS "year.dbf" HBTEST RangeRem( "9", "0", "year2002.dbf" ) IS "22" diff --git a/harbour/contrib/hbmisc/doc/en/ht_str.txt b/harbour/contrib/hbmisc/doc/en/ht_str.txt index c163f1ac6c..c9fc116f80 100644 --- a/harbour/contrib/hbmisc/doc/en/ht_str.txt +++ b/harbour/contrib/hbmisc/doc/en/ht_str.txt @@ -28,17 +28,6 @@ StrFormat( "Please insert disk %1 to drive %2", hb_ntos( 2 ), "A:" ) StrFormat( "This is %1 from %2", "Victor", "Hungary" ) StrFormat( "%2 %1 %2", "Param1", "Param2" ) - $TESTS$ - ? StrFormat( "Please insert disk %1 to drive %2", hb_ntos( 2 ), "A:" ) - ? StrFormat( "This is %1 from %2", "Victor", "Hungary" ) - ? StrFormat( "%2 %1 %2", "Param1", "Param2" ) - ? StrFormat( "Hello" ) - ? StrFormat( "%1 - %2", "one" ) - ? StrFormat( "%1 - %2", "one", "two" ) - ? StrFormat( "%2 - %1", "one", "two" ) - ? StrFormat( "%2 - %", "one", "two" ) - ? StrFormat( "%% - %", "one", "two" ) - ? StrFormat( "%9 - %", "one", "two" ) $STATUS$ Done $COMPLIANCE$ diff --git a/harbour/contrib/hbmisc/tests/tsstrfmt.prg b/harbour/contrib/hbmisc/tests/tsstrfmt.prg index 61319f13fd..bfec8cd308 100644 --- a/harbour/contrib/hbmisc/tests/tsstrfmt.prg +++ b/harbour/contrib/hbmisc/tests/tsstrfmt.prg @@ -4,16 +4,29 @@ #require "hbmisc" +#include "hbtest.ch" + PROCEDURE Main() - ? StrFormat( "%1 thing %2", "a", "b" ) - ? StrFormat( "%1 thing %2", "a", Date() ) - ? StrFormat( "%1 thing %2", .T., Date() ) - ? StrFormat( "%1 thing %2", .T., NIL ) - ? StrFormat( "%1 thing %2", "space1 ", 100.20 ) - ? StrFormat( "%1 thing %2", " space2 ", 213 ) - ? StrFormat( "%1 thing %2", " space3", 0.12 ) - ? StrFormat( "%2 thing %1 stuff", " space3", 0.12 ) - ? StrFormat( "%2 %1 born on %3", "Smith", "Mr.", Date() ) + HBTEST StrFormat( "%1 thing %2", "a", "b" ) IS "a thing b" + HBTEST StrFormat( "%1 thing %2", "a", Date() ) IS "a thing 2012.11.27" + HBTEST StrFormat( "%1 thing %2", .T., Date() ) IS ".T. thing 2012.11.27" + HBTEST StrFormat( "%1 thing %2", .T., NIL ) IS ".T. thing NIL" + HBTEST StrFormat( "%1 thing %2", "space1 ", 100.20 ) IS "space1 thing 100.20" + HBTEST StrFormat( "%1 thing %2", " space2 ", 213 ) IS "space2 thing 213" + HBTEST StrFormat( "%1 thing %2", " space3", 0.12 ) IS "space3 thing 0.12" + HBTEST StrFormat( "%2 thing %1 stuff", " space3", 0.12 ) IS "0.12 thing space3 stuff" + HBTEST StrFormat( "%2 %1 born on %3", "Smith", "Mr.", 0d20121127 ) IS "Mr. Smith born on 2012.11.27" + + HBTEST StrFormat( "Please insert disk %1 to drive %2", hb_ntos( 2 ), "A:" ) IS "Please insert disk 2 to drive A:" + HBTEST StrFormat( "This is %1 from %2", "Victor", "Europe" ) IS "This is Victor from Europe" + HBTEST StrFormat( "%2 %1 %2", "Param1", "Param2" ) IS "Param2 Param1 Param2" + HBTEST StrFormat( "Hello" ) IS "Hello" + HBTEST StrFormat( "%1 - %2", "one" ) IS "one - " + HBTEST StrFormat( "%1 - %2", "one", "two" ) IS "one - two" + HBTEST StrFormat( "%2 - %1", "one", "two" ) IS "two - one" + HBTEST StrFormat( "%2 - %", "one", "two" ) IS "two - " + HBTEST StrFormat( "%% - %", "one", "two" ) IS "% - " + HBTEST StrFormat( "%9 - %", "one", "two" ) IS " - " RETURN diff --git a/harbour/doc/class_tp.txt b/harbour/doc/class_tp.txt index 31c9a7a561..be7b03af92 100644 --- a/harbour/doc/class_tp.txt +++ b/harbour/doc/class_tp.txt @@ -100,8 +100,6 @@ CLASS HEADER TEMPLATE $EXAMPLES$ - $TESTS$ - $STATUS$ $COMPLIANCE$ diff --git a/harbour/doc/hdr_tpl.txt b/harbour/doc/hdr_tpl.txt index c6c2c6e678..43d3effddf 100644 --- a/harbour/doc/hdr_tpl.txt +++ b/harbour/doc/hdr_tpl.txt @@ -93,8 +93,6 @@ FUNCTION HEADER TEMPLATE $EXAMPLES$ - $TESTS$ - $STATUS$ $COMPLIANCE$ @@ -137,14 +135,6 @@ HEADER EXAMPLES ELSE ? "A normal year" ENDIF - $TESTS$ - ValType( IsLeapYr( Date() ) ) == "L" - ValType( IsLeapYr( hb_SToD() ) ) == "L" - ValType( IsLeapYr() ) == "L" - IsLeapYr( hb_SToD( "20000101" ) ) - ! IsLeapYr( hb_SToD( "19000101" ) ) - IsLeapYr( hb_SToD( "19841231" ) ) - !IsLeapYr() $STATUS$ C $COMPLIANCE$