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

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

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

%exec-class ModuleWarningTest

class ModuleWarningTest inherits QUnit::Test {
    constructor() : QUnit::Test("Module Warning Test", "1.0") {
        addTestCase("warning test", \warningTest());
        set_return_value(main());
    }

    warningTest() {
        Program p1();
        p1.setScriptPath(get_script_path());
        Program p2();
        hash<ExceptionInfo> h = p1.loadUserModuleWithProgramWarn("./Issue3212.qm", p2, WARN_MODULES | WARN_DEPRECATED);
        assertEq("DEPRECATED", h.err);
    }
}
