Index: test/num.test ================================================================== --- test/num.test +++ test/num.test @@ -27,7 +27,14 @@ } {equal} # Is +0 > -0? #do_test num-equal-1.1.4 { # sqlite4_num_compare +0 -0 #} {equal} + +do_test num-2.1.1 { + sqlite4_num_to_text [sqlite4_num_from_text 37] +} {37} +do_test num-2.1.2 { + sqlite4_num_to_text [sqlite4_num_from_text 37 2] +} {37} finish_test Index: test/test_main.c ================================================================== --- test/test_main.c +++ test/test_main.c @@ -4439,10 +4439,27 @@ A = sqlite4_num_from_text( argv[1], len, 0 ); append_num_result(interp, A); return TCL_OK; } + +static int test_num_to_text( + void *NotUsed, + Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ + int argc, /* Number of arguments */ + char **argv /* Text of each argument */ +){ + char text[30]; + if( argc!=2 ){ + Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], + " NUM\"", 0); + return TCL_ERROR; + } + sqlite4_num_to_text( test_parse_num( argv[1] ), text ); + Tcl_AppendResult( interp, text, 0 ); + return TCL_OK; +} /* ** Register commands with the TCL interpreter. */ int Sqlitetest1_Init(Tcl_Interp *interp){ @@ -4495,10 +4512,11 @@ { "sqlite4_stack_used", (Tcl_CmdProc*)test_stack_used }, { "printf", (Tcl_CmdProc*)test_printf }, { "sqlite4IoTrace", (Tcl_CmdProc*)test_io_trace }, { "sqlite4_num_compare", (Tcl_CmdProc*)test_num_compare }, { "sqlite4_num_from_text", (Tcl_CmdProc*)test_num_from_text }, + { "sqlite4_num_to_text", (Tcl_CmdProc*)test_num_to_text }, }; static struct { char *zName; Tcl_ObjCmdProc *xProc; void *clientData;