#!/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 GetExPosTest

public class GetExPosTest inherits QUnit::Test {
    constructor() : Test("GetExPosTest", "1.0") {
        addTestCase("get_ex_pos() test", \getExPosTest());

        # Return for compatibility with test harness that checks return value.
        set_return_value(main());
    }

    getExPosTest() {
        try {
            if (True) {
                throw "ERR", "desc";
            }
            assertTrue(False);
        } catch (hash<ExceptionInfo> ex) {
            string str = get_ex_pos(ex);
            assertRegex("get_ex_pos.qtest:24 \\(Qore\\)$", str);
        }
    }
}
