Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 903C6200D07 for ; Sun, 1 Oct 2017 14:33:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8ED671609C0; Sun, 1 Oct 2017 12:33:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D4B031609D9 for ; Sun, 1 Oct 2017 14:33:47 +0200 (CEST) Received: (qmail 59014 invoked by uid 500); 1 Oct 2017 12:33:47 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 59005 invoked by uid 99); 1 Oct 2017 12:33:46 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Oct 2017 12:33:46 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 79DB6F5629; Sun, 1 Oct 2017 12:33:46 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: pascalschumacher@apache.org To: commits@commons.apache.org Date: Sun, 01 Oct 2017 12:33:47 -0000 Message-Id: In-Reply-To: <56e7f40e6f8a4ea6862c979ef64c8408@git.apache.org> References: <56e7f40e6f8a4ea6862c979ef64c8408@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] [lang] Clean up if in CharUtilsTest#testIsAscii_char archived-at: Sun, 01 Oct 2017 12:33:48 -0000 Clean up if in CharUtilsTest#testIsAscii_char The if statement calls assertTrue on the if branch and assertFalse on the else branch on the same expression. This can easily be simplified to assertEquals with a boolean expression to make the code clean and easier to read. Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/c7554151 Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/c7554151 Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/c7554151 Branch: refs/heads/master Commit: c7554151d3f695718a5bd431e22c7f4c39a0b261 Parents: 7076b74 Author: Allon Mureinik Authored: Sat Sep 30 15:25:34 2017 +0300 Committer: pascalschumacher Committed: Sun Oct 1 14:33:16 2017 +0200 ---------------------------------------------------------------------- src/test/java/org/apache/commons/lang3/CharUtilsTest.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/c7554151/src/test/java/org/apache/commons/lang3/CharUtilsTest.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/lang3/CharUtilsTest.java b/src/test/java/org/apache/commons/lang3/CharUtilsTest.java index bd92c33..35f7f02 100644 --- a/src/test/java/org/apache/commons/lang3/CharUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/CharUtilsTest.java @@ -220,11 +220,7 @@ public class CharUtilsTest { assertFalse(CharUtils.isAscii(CHAR_COPY)); for (int i = 0; i < 128; i++) { - if (i < 128) { - assertTrue(CharUtils.isAscii((char) i)); - } else { - assertFalse(CharUtils.isAscii((char) i)); - } + assertEquals(i < 128, CharUtils.isAscii((char) i)); } }