@@ -410,15 +410,20 @@ 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, 'ex' , 'Apple-class.html' ));
418
+ expect (level1.existsSync (), isTrue);
418
419
expect (
419
- file .readAsStringSync (),
420
+ level1 .readAsStringSync (),
420
421
contains (
421
- '<link rel="canonical" href="$prefix /small/small-library.html">' ));
422
+ '<link rel="canonical" href="$prefix /ex/Apple-class.html">' ));
423
+ File level2 = File (path.join (tempDir.path, 'ex' , 'Apple' , 'm.html' ));
424
+ expect (level2.existsSync (), isTrue);
425
+ expect (level2.readAsStringSync (),
426
+ contains ('<link rel="canonical" href="$prefix /ex/Apple/m.html">' ));
422
427
});
423
428
}, timeout: Timeout .factor (8 ));
424
429
}
0 commit comments