Commit f3ea0996 authored by Robert Wilhelm's avatar Robert Wilhelm Committed by Alexandre Julliard

vbscript: Implement IsDate().

parent 86612073
......@@ -935,8 +935,13 @@ static HRESULT Global_VarType(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt
static HRESULT Global_IsDate(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
{
FIXME("\n");
return E_NOTIMPL;
TRACE("%s\n", debugstr_variant(arg));
if(res) {
V_VT(res) = VT_BOOL;
V_BOOL(res) = V_VT(arg) == VT_DATE ? VARIANT_TRUE : VARIANT_FALSE;
}
return S_OK;
}
static HRESULT Global_IsEmpty(BuiltinDisp *This, VARIANT *arg, unsigned args_cnt, VARIANT *res)
......
......@@ -181,6 +181,20 @@ Call ok(not isObject(4), "isObject(4) is true?")
Call ok(not isObject("x"), "isObject(""x"") is true?")
Call ok(not isObject(Null), "isObject(Null) is true?")
Call ok(not isDate(new EmptyClass), "isDate(new EmptyClass) is true?")
Set x = new EmptyClass
Call ok(not isDate(x), "isDate(x) is true?")
x = CDate(1)
Call ok(isDate(x), "isDate(x) is not true?")
Call ok(isDate(#1/1/2000#), "isDate(#1/1/2000#) is not true?")
Call ok(not isDate(empty), "isDate(empty) is true?")
Call ok(not isDate(Nothing), "isDate(Nothing) is true?")
Call ok(not isDate(true), "isDate(true) is true?")
Call ok(not isDate(4), "isDate(4) is true?")
Call ok(not isDate("4"), "isDate(""4"") is true?")
Call ok(not isDate("x"), "isDate(""x"") is true?")
Call ok(not isDate(Null), "isDate(Null) is true?")
Call ok(not isEmpty(new EmptyClass), "isEmpty(new EmptyClass) is true?")
Set x = new EmptyClass
Call ok(not isEmpty(x), "isEmpty(x) is true?")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment