@@ -469,88 +469,4 @@ void main() {
469
469
expect (response.data, 'test' );
470
470
}
471
471
});
472
-
473
- test ('Ensure consistent slash handling' , () {
474
- final dio = Dio ();
475
- final inputs = [
476
- ['https://www.example.com' , 'path' ],
477
- ['https://www.example.com/' , 'path' ],
478
- ['https://www.example.com' , '/path' ],
479
- ['https://www.example.com/' , '/path' ],
480
- ];
481
-
482
- for (final input in inputs) {
483
- final baseUrl = input[0 ];
484
- final path = input[1 ];
485
- dio.options.baseUrl = baseUrl;
486
- final actual = Options ().compose (dio.options, path).uri.toString ();
487
- expect (actual, equals ('https://www.example.com/path' ));
488
- }
489
- });
490
-
491
- test ('Should return absolute URI when path is already absolute' , () {
492
- final baseUrl = 'https://www.example.com' ;
493
- final path = 'https://www.another-example.com/path/to/resource' ;
494
- final baseOptions = BaseOptions (baseUrl: baseUrl);
495
-
496
- final actual = Options ().compose (baseOptions, path).uri;
497
-
498
- expect (actual.toString (), equals (path));
499
- });
500
-
501
- test ('Should resolve relative path with base URL' , () {
502
- final baseUrl = 'https://www.example.com' ;
503
- final path = '/path/to/resource' ;
504
- final baseOptions = BaseOptions (baseUrl: baseUrl);
505
-
506
- final actual = Options ().compose (baseOptions, path).uri;
507
-
508
- expect (
509
- actual.toString (),
510
- equals ('https://www.example.com/path/to/resource' ),
511
- );
512
- });
513
-
514
- test ('Should add query parameters to the URI' , () {
515
- final baseUrl = 'https://www.example.com' ;
516
- final path = '/path/to/resource' ;
517
- final baseOptions = BaseOptions (
518
- baseUrl: baseUrl,
519
- queryParameters: {'param1' : 'value1' },
520
- );
521
-
522
- final actual = Options ().compose (
523
- baseOptions,
524
- path,
525
- queryParameters: {'param2' : 'value2' },
526
- ).uri;
527
-
528
- expect (
529
- actual.queryParameters,
530
- equals ({
531
- 'param1' : 'value1' ,
532
- 'param2' : 'value2' ,
533
- }),
534
- );
535
- });
536
-
537
- test ('Should preserve path query parameters to the URI' , () {
538
- final baseUrl = 'https://www.example.com' ;
539
- final path = '/path/to/resource?param1=value1' ;
540
- final baseOptions = BaseOptions (baseUrl: baseUrl);
541
-
542
- final actual = Options (listFormat: ListFormat .csv).compose (
543
- baseOptions,
544
- path,
545
- queryParameters: {'param2' : 'value2' },
546
- ).uri;
547
-
548
- expect (
549
- actual.queryParameters,
550
- equals ({
551
- 'param1' : 'value1' ,
552
- 'param2' : 'value2' ,
553
- }),
554
- );
555
- });
556
472
}
0 commit comments