#!/usr/bin/env qore
# -*- mode: qore; indent-tabs-mode: nil -*-

%new-style
%enable-all-warnings
%require-types
%strict-args

%requires ../../../../qlib/QUnit.qm

%exec-class CastToIntTest

class CastToIntTest inherits QUnit::Test {

    constructor() : QUnit::Test("IntTest", "1.0") {
        addTestCase("castToIntTests", \castToIntTests());
        set_return_value(main());
    }

    castToIntTests() {
        assertEq(int(7.8), 7);
        assertEq(int(7.8n), 7);
        softint f = 7.8;
        softint n = 7.8n;
        assertEq(f, 7);
        assertEq(n, 7);
    }
}
