@@ -410,13 +410,19 @@ void main() {
410
410
test ('rel canonical prefix does not include base href' , () async {
411
411
final String prefix = 'foo.bar/baz' ;
412
412
Dartdoc dartdoc = await buildDartdoc (
413
- ['--rel-canonical-prefix' , prefix], testPackageMinimumDir , tempDir);
413
+ ['--rel-canonical-prefix' , prefix], testPackageDir , tempDir);
414
414
await dartdoc.generateDocsBase ();
415
415
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 level1 = File (path.join (tempDir.path, 'index.html' ));
418
+ expect (level1.existsSync (), isTrue);
419
+ expect (level1.readAsStringSync (),
420
+ contains ('<link rel="canonical" href="$prefix /index.html">' ));
421
+ File level2 =
422
+ File (path.join (tempDir.path, 'small' , 'small-library.html' ));
423
+ expect (level2.existsSync (), isTrue);
418
424
expect (
419
- file .readAsStringSync (),
425
+ level2 .readAsStringSync (),
420
426
contains (
421
427
'<link rel="canonical" href="$prefix /small/small-library.html">' ));
422
428
});
0 commit comments