@@ -117,6 +117,15 @@ void aliasMode() throws IOException {
117117 assertEquals (str , wireToString (bytes ));
118118 }
119119
120+ @ Test
121+ void serviceModeWithoutParameters () throws IOException {
122+ String str = "1 ." ;
123+ byte [] bytes = stringToWire (str );
124+ byte [] expected = new byte [] {0 , 1 , 0 };
125+ assertArrayEquals (expected , bytes );
126+ assertEquals (str , wireToString (bytes ));
127+ }
128+
120129 @ Test
121130 void serviceModePort () throws IOException {
122131 String str = "1 . port=8443" ;
@@ -319,6 +328,7 @@ void masterFormatParsing() throws IOException {
319328 + "test.net. 86400 IN NS ns1.test.net.\n "
320329 + "test.net. 300 IN HTTPS 0 www.test.net.\n "
321330 + "test.net. 300 IN SVCB 1 . alpn=h2\n "
331+ + "test.net. 300 IN HTTPS 1 .\n "
322332 + "www.test.net. 300 IN A 1.2.3.4\n " ;
323333 Master m = new Master (new ByteArrayInputStream (str .getBytes ()));
324334
@@ -333,6 +343,9 @@ void masterFormatParsing() throws IOException {
333343 assertEquals (Type .SVCB , r .getType ());
334344 assertEquals ("1 . alpn=h2" , r .rdataToString ());
335345 r = m .nextRecord ();
346+ assertEquals (Type .HTTPS , r .getType ());
347+ assertEquals ("1 ." , r .rdataToString ());
348+ r = m .nextRecord ();
336349 assertEquals (Type .A , r .getType ());
337350 assertEquals ("1.2.3.4" , r .rdataToString ());
338351 r = m .nextRecord ();
@@ -351,12 +364,6 @@ void extraQuotesInParamValues() {
351364 assertThrows (TextParseException .class , () -> stringToWire (str ));
352365 }
353366
354- @ Test
355- void serviceModeWithoutParameters () {
356- String str = "1 aliasmode.example.com." ;
357- assertThrows (TextParseException .class , () -> stringToWire (str ));
358- }
359-
360367 @ Test
361368 void aliasModeWithParameters () {
362369 String str = "0 . alpn=h3" ;
@@ -465,12 +472,6 @@ void emptyString() {
465472 assertThrows (TextParseException .class , () -> stringToWire (str ));
466473 }
467474
468- @ Test
469- void noParamValues () {
470- String str = "1 ." ;
471- assertThrows (TextParseException .class , () -> stringToWire (str ));
472- }
473-
474475 @ Test
475476 void svcPriorityTooHigh () {
476477 String str = "65536 . port=443" ;
0 commit comments