summaryrefslogtreecommitdiff
path: root/.config/coc/extensions/node_modules/coc-go/lib/utils/tests.test.js
blob: 70d08017d7598241ec75a386b7c22b3185280497 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const assert_1 = tslib_1.__importDefault(require("assert"));
const tests_1 = require("./tests");
describe('extractFunctionName()', () => {
    const cases = [
        ['', null],
        ['\tfuncFoo()', null],
        ['func Foo() {', 'Foo'],
        ['func Foo() string {', 'Foo'],
        ['func Foo(str string) string {', 'Foo'],
        ['func (b *Bar) Foo(str string) string {', 'Foo'],
    ];
    cases.forEach(([line, name]) => {
        it(`should extract ${JSON.stringify(name)} from "${line}"`, () => {
            assert_1.default.equal(name, (0, tests_1.extractFunctionName)(line));
        });
    });
});
//# sourceMappingURL=tests.test.js.map