blob: bb431d2d935344cfa6f4d16b36c31464d9497178 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:doc_checker/link_scraper.dart';
import 'package:test/test.dart';
void main() {
group('doc_checker link_scraper tests', () {
test('no links found in plain text', () {
final List<String> lines = ['this text has no links', 'same here'];
expect(LinkScraper().scrapeLines(lines).isEmpty, isTrue);
});
test('links get scraped', () {
final List<String> lines = [
'this text has no links',
'this one [does](link.md).',
'but not *this one*'
];
Iterable<String> links = LinkScraper().scrapeLines(lines);
expect(links, hasLength(1));
expect(links.first, equals('link.md'));
});
});
}