2003-05-01 20:40:41 +00:00
|
|
|
#include <fmt.h>
|
|
|
|
#include <str.h>
|
|
|
|
#include <assert.h>
|
|
|
|
|
2004-11-25 21:52:35 +00:00
|
|
|
int main() {
|
2003-05-01 20:40:41 +00:00
|
|
|
char buf[1024];
|
|
|
|
|
|
|
|
assert(fmt_long(0,12345)==5);
|
|
|
|
assert(fmt_long(0,-12345)==6);
|
|
|
|
assert(fmt_long(buf,12345)==5); buf[5]=0;
|
|
|
|
assert(str_equal(buf,"12345"));
|
|
|
|
assert(fmt_long(buf,-12345)==6); buf[6]=0;
|
|
|
|
assert(str_equal(buf,"-12345"));
|
2004-11-25 21:52:35 +00:00
|
|
|
return 0;
|
2003-05-01 20:40:41 +00:00
|
|
|
}
|