@@ -72,6 +72,32 @@ fn test_basic_sourcemap_with_root() {
7272 assert ! ( iter. next( ) . is_none( ) ) ;
7373}
7474
75+ #[ test]
76+ fn test_basic_sourcemap_with_absolute_uri_root ( ) {
77+ let input: & [ _ ] = b"{
78+ \" version\" :3,
79+ \" sources\" :[\" coolstuff.js\" , \" ./evencoolerstuff.js\" ],
80+ \" sourceRoot\" :\" webpack:///\" ,
81+ \" names\" :[\" x\" ,\" alert\" ],
82+ \" mappings\" :\" AAAA,GAAIA,GAAI,EACR,ICAIA,GAAK,EAAG,CACVC,MAAM\"
83+ }" ;
84+ let sm = SourceMap :: from_reader ( input) . unwrap ( ) ;
85+ let mut iter = sm. tokens ( ) . filter ( Token :: has_name) ;
86+ assert_eq ! (
87+ iter. next( ) . unwrap( ) . to_tuple( ) ,
88+ ( "webpack:///coolstuff.js" , 0 , 4 , Some ( "x" ) )
89+ ) ;
90+ assert_eq ! (
91+ iter. next( ) . unwrap( ) . to_tuple( ) ,
92+ ( "webpack:///./evencoolerstuff.js" , 1 , 4 , Some ( "x" ) )
93+ ) ;
94+ assert_eq ! (
95+ iter. next( ) . unwrap( ) . to_tuple( ) ,
96+ ( "webpack:///./evencoolerstuff.js" , 2 , 2 , Some ( "alert" ) )
97+ ) ;
98+ assert ! ( iter. next( ) . is_none( ) ) ;
99+ }
100+
75101#[ test]
76102fn test_sourcemap_data_url ( ) {
77103 let url = "data:application/json;base64,\
0 commit comments