File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed
Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -139,14 +139,25 @@ bool nodejs1() {
139139 TEST_SUCCEED ()
140140}
141141
142+ bool nodejs2 () {
143+ TEST_START ()
144+ auto url = ada::parse (" data:space ?test" );
145+ TEST_ASSERT (url->get_search (), " ?test" , " search is not equal" );
146+ url->set_search (" " );
147+ TEST_ASSERT (url->get_search (), " " , " search should have been empty" );
148+ TEST_ASSERT (url->get_pathname (), " space" , " pathname should have been 'space' without trailing spaces" );
149+ TEST_ASSERT (url->get_href (), " data:space" , " href is not equal" );
150+ TEST_SUCCEED ()
151+ }
152+
142153int main () {
143154 bool success = set_host_should_return_false_sometimes ()
144155 && set_host_should_return_true_sometimes ()
145156 && set_hostname_should_return_false_sometimes ()
146157 && set_hostname_should_return_true_sometimes ()
147158 && readme1 () && readme2 () && readme3 ()
148159 && readme4 () && readme5 () && readme6 ()
149- && readme7 () && nodejs1 ();
160+ && readme7 () && nodejs1 () && nodejs2 () ;
150161 if (success) { return EXIT_SUCCESS; }
151162 return EXIT_FAILURE;
152163}
Original file line number Diff line number Diff line change 206206 "input" : " file://localhost:8098/path/to/file.txt" ,
207207 "base" : " about:blank" ,
208208 "failure" : true
209+ },
210+ {
211+ "input" : " data:space ?test#test" ,
212+ "base" : " about:blank" ,
213+ "href" : " data:space ?test#test" ,
214+ "origin" : " null" ,
215+ "protocol" : " data:" ,
216+ "username" : " " ,
217+ "password" : " " ,
218+ "host" : " " ,
219+ "hostname" : " " ,
220+ "port" : " " ,
221+ "pathname" : " space " ,
222+ "search" : " ?test" ,
223+ "hash" : " #test"
209224 }
210225]
You can’t perform that action at this time.
0 commit comments