@@ -87,9 +87,14 @@ TEST(ada_c, setters) {
8787
8888 ada_set_port (url, " 4242" , 4 );
8989 ASSERT_EQ (convert_string (ada_get_port (url)), " 4242" );
90+ ada_clear_port (url);
91+ ASSERT_EQ (convert_string (ada_get_port (url)), " " );
92+ ASSERT_FALSE (ada_has_port (url));
9093
9194 ada_set_hash (url, " new-hash" , strlen (" new-hash" ));
9295 ASSERT_EQ (convert_string (ada_get_hash (url)), " #new-hash" );
96+ ada_clear_hash (url);
97+ ASSERT_FALSE (ada_has_hash (url));
9398
9499 ada_set_hostname (url, " new-host" , strlen (" new-host" ));
95100 ASSERT_EQ (convert_string (ada_get_hostname (url)), " new-host" );
@@ -99,9 +104,13 @@ TEST(ada_c, setters) {
99104
100105 ada_set_pathname (url, " new-pathname" , strlen (" new-pathname" ));
101106 ASSERT_EQ (convert_string (ada_get_pathname (url)), " /new-pathname" );
107+ ada_clear_pathname (url);
108+ ASSERT_EQ (convert_string (ada_get_pathname (url)), " " );
102109
103110 ada_set_search (url, " new-search" , strlen (" new-search" ));
104111 ASSERT_EQ (convert_string (ada_get_search (url)), " ?new-search" );
112+ ada_clear_search (url);
113+ ASSERT_EQ (convert_string (ada_get_search (url)), " " );
105114
106115 ada_set_protocol (url, " wss" , 3 );
107116 ASSERT_EQ (convert_string (ada_get_protocol (url)), " wss:" );
0 commit comments