11cb0ef41Sopenharmony_ciimport '../common/index.mjs';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciimport assert from 'assert';
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ciimport { referenceToLocalMdFile } from '../../tools/doc/markdown.mjs';
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ci{
81cb0ef41Sopenharmony_ci  const shouldBeSpotted = [
91cb0ef41Sopenharmony_ci    'test.md',
101cb0ef41Sopenharmony_ci    'TEST.MD',
111cb0ef41Sopenharmony_ci    'test.js.md',
121cb0ef41Sopenharmony_ci    '.test.md',
131cb0ef41Sopenharmony_ci    './test.md',
141cb0ef41Sopenharmony_ci    'subfolder/test.md',
151cb0ef41Sopenharmony_ci    '../test.md',
161cb0ef41Sopenharmony_ci    'test.md#anchor',
171cb0ef41Sopenharmony_ci    'subfolder/test.md#anchor',
181cb0ef41Sopenharmony_ci    '/test.md',
191cb0ef41Sopenharmony_ci  ];
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ci  shouldBeSpotted.forEach((url) => {
221cb0ef41Sopenharmony_ci    assert.match(url, referenceToLocalMdFile);
231cb0ef41Sopenharmony_ci  });
241cb0ef41Sopenharmony_ci}
251cb0ef41Sopenharmony_ci
261cb0ef41Sopenharmony_ci{
271cb0ef41Sopenharmony_ci  const shouldNotBeSpotted = [
281cb0ef41Sopenharmony_ci    'https://example.com/test.md',
291cb0ef41Sopenharmony_ci    'HTTPS://EXAMPLE.COM/TEST.MD',
301cb0ef41Sopenharmony_ci    'git+https://example.com/test.md',
311cb0ef41Sopenharmony_ci    'ftp://1.1.1.1/test.md',
321cb0ef41Sopenharmony_ci    'urn:isbn:9780307476463.md',
331cb0ef41Sopenharmony_ci    'file://./test.md',
341cb0ef41Sopenharmony_ci    '/dev/null',
351cb0ef41Sopenharmony_ci    'test.html',
361cb0ef41Sopenharmony_ci    'test.html#anchor.md',
371cb0ef41Sopenharmony_ci    'test.html?anchor.md',
381cb0ef41Sopenharmony_ci    'test.md5',
391cb0ef41Sopenharmony_ci    'testmd',
401cb0ef41Sopenharmony_ci    '.md',
411cb0ef41Sopenharmony_ci  ];
421cb0ef41Sopenharmony_ci
431cb0ef41Sopenharmony_ci  shouldNotBeSpotted.forEach((url) => {
441cb0ef41Sopenharmony_ci    assert.doesNotMatch(url, referenceToLocalMdFile);
451cb0ef41Sopenharmony_ci  });
461cb0ef41Sopenharmony_ci}
47