#!/usr/bin/env qore

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

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

%exec-class RegexEscapeTest

public class RegexEscapeTest inherits QUnit::Test {
    constructor() : Test ("RegexEscapeTest", "1.0") {
        addTestCase ("Tests for regex_escape() function", \test_regex_escape());
        set_return_value(main());
    }

    test_regex_escape() {
        assertEq ('', regex_escape (''));
        assertEq ('Hungry\?', regex_escape ('Hungry?'));
        assertEq ('Always\!\!', regex_escape ('Always!!'));
        assertEq ('\[12\ 34\ 56\ 78\ 90\]', regex_escape ('[12 34 56 78 90]'));
    }
}
