#!/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 p();
        p.setScriptPath(get_script_path());
        hash<ExceptionInfo> h = p.loadApplyToPrivateUserModuleWarn("./Issue3212.qm", WARN_MODULES | WARN_DEPRECATED);
        assertEq("DEPRECATED", h.err);
    }
}
