@confluentinc/schemaregistry
Version:
Node.js client for Confluent Schema Registry
88 lines (87 loc) • 4.16 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const wildcard_matcher_1 = require("../../serde/wildcard-matcher");
const globals_1 = require("@jest/globals");
(0, globals_1.describe)('WildcardMatcher', () => {
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('', 'Foo')).toBe(false);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('Foo', '')).toBe(false);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('', '')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('Foo', 'Foo')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('', '*')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('', '?')).toBe(false);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('Foo', 'Fo*')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('Foo', 'Fo?')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('Foo Bar and Catflag', 'Fo*')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('New Bookmarks', 'N?w ?o?k??r?s')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('Foo', 'Bar')).toBe(false);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('Foo Bar Foo', 'F*o Bar*')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('Adobe Acrobat Installer', 'Ad*er')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('Foo', '*Foo')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('BarFoo', '*Foo')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('Foo', 'Foo*')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('FOO', '*Foo')).toBe(false);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('BARFOO', '*Foo')).toBe(false);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('FOO', 'Foo*')).toBe(false);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('FOOBAR', 'Foo*')).toBe(false);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('eve', 'eve*')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('alice.bob.eve', 'a*.bob.eve')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('alice.bob.eve', 'a*.bob.e*')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('alice.bob.eve', 'a*')).toBe(false);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('alice.bob.eve', 'a**')).toBe(true);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('alice.bob.eve', 'alice.bob*')).toBe(false);
});
(0, globals_1.it)('when match', () => {
(0, globals_1.expect)((0, wildcard_matcher_1.match)('alice.bob.eve', 'alice.bob**')).toBe(true);
});
});