11/*
22 * Copyright (c) 2023, 2024 Oracle and/or its affiliates. All rights reserved.
3+ * Copyright (c) 2025 Contributors to the Eclipse Foundation. All rights reserved.
34 *
45 * This program and the accompanying materials are made available under the
56 * terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -84,6 +85,8 @@ public void testPrint() {
8485 @ Test
8586 public void testBase64 () {
8687 Assert .assertThrows (IllegalArgumentException .class , () -> DatatypeConverter .parseBase64Binary ("Qxx==" ));
88+ Assert .assertThrows (IllegalArgumentException .class , () -> DatatypeConverter .parseBase64Binary ("SGVsbG8sIJdvcmxkIQQxx==" ));
89+ Assert .assertThrows (IllegalArgumentException .class , () -> DatatypeConverter .parseBase64Binary ("dGhpcyBpcyB\n hbiBleGFtcGxl==" ));
8790
8891 Assert .assertEquals ("" , new String (DatatypeConverter .parseBase64Binary ("" )));
8992 Assert .assertEquals ("f" , new String (DatatypeConverter .parseBase64Binary ("Zg==" )));
@@ -92,6 +95,9 @@ public void testBase64() {
9295 Assert .assertEquals ("foob" , new String (DatatypeConverter .parseBase64Binary ("Zm9vYg==" )));
9396 Assert .assertEquals ("fooba" , new String (DatatypeConverter .parseBase64Binary ("Zm9vYmE=" )));
9497 Assert .assertEquals ("foobar" , new String (DatatypeConverter .parseBase64Binary ("Zm9vYmFy" )));
98+ Assert .assertEquals ("this is an example" , new String (DatatypeConverter .parseBase64Binary ("dGhpcyBpcyB hbiBleGFtcGxl" )));
99+ Assert .assertEquals ("this is an example" , new String (DatatypeConverter .parseBase64Binary ("dGhpcyBpcyB\n hbiBleGFtcGxl" )));
100+ Assert .assertEquals ("this is an example" , new String (DatatypeConverter .parseBase64Binary ("dGhpcyBpcyB\t hbiBleGFtcGxl" )));
95101
96102 Assert .assertNotEquals ("Hello, world!" , new String (DatatypeConverter .parseBase64Binary ("SGVsbG8sIJdvcmxkIQ==" )));
97103
0 commit comments