Skip to content

Commit 7fa34d9

Browse files
committed
Verify files at different levels in test
1 parent 774022c commit 7fa34d9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/dartdoc_test.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,10 +413,16 @@ void main() {
413413
['--rel-canonical-prefix', prefix], testPackageMinimumDir, tempDir);
414414
await dartdoc.generateDocsBase();
415415

416-
File file = File(path.join(tempDir.path, 'small', 'small-library.html'));
417-
expect(file.existsSync(), isTrue);
416+
// Verify files at different levels have correct <link> content.
417+
File atRoot = File(path.join(tempDir.path, 'index.html'));
418+
expect(atRoot.existsSync(), isTrue);
419+
expect(atRoot.readAsStringSync(),
420+
contains('<link rel="canonical" href="$prefix/index.html">'));
421+
File notAtRoot =
422+
File(path.join(tempDir.path, 'small', 'small-library.html'));
423+
expect(notAtRoot.existsSync(), isTrue);
418424
expect(
419-
file.readAsStringSync(),
425+
notAtRoot.readAsStringSync(),
420426
contains(
421427
'<link rel="canonical" href="$prefix/small/small-library.html">'));
422428
});

0 commit comments

Comments
 (0)