.autotest

git-svn-id: svn://ultimatepp.org/upp/trunk@16007 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2021-06-26 19:17:24 +00:00
parent 42a6fa7062
commit a788390fc7

View file

@ -9,7 +9,16 @@ void Test(Convert& cv, const char *s, Value res)
if(IsError(res))
ASSERT(IsError(v));
else
ASSERT(v == res);
if(IsNumber(v)) {
double x = res;
double y = v;
if(y == 0)
ASSERT(x == 0);
else
ASSERT(abs((x - y) / x) < 0.00000000000001);
}
else
ASSERT(res == v);
}
CONSOLE_APP_MAIN