Added parameterized tests and related fixes

This commit is contained in:
Erik C. Thauvin 2023-01-02 02:17:55 -08:00
parent 3ff4549d0e
commit 1370da18bb
2 changed files with 119 additions and 106 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright 2001-2022 Geert Bevin (gbevin[remove] at uwyn dot com)
* Copyright 2001-2023 Geert Bevin (gbevin[remove] at uwyn dot com)
* Licensed under the Apache License, Version 2.0 (the "License")
*/
package com.uwyn.urlencoder;
@ -167,7 +167,7 @@ public final class UrlEncoder {
* @since 1.0
*/
public static String encode(String source, String allow) {
if (source == null || source.isBlank()) {
if (source == null || source.isEmpty()) {
return source;
}
@ -246,7 +246,7 @@ public final class UrlEncoder {
}
var text = "";
if (args.size() == 1) {
if (args.size() == 1 && !args.get(0).isEmpty()) {
text = args.remove(0);
valid_arguments = true;
}