From d082215b12d195f8ede58397a424bf95f005b0b4 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 10 Dec 2017 16:53:41 +0000 Subject: [PATCH] Add tests for equality --- src/test/java/net/kemitix/mon/MaybeTest.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/test/java/net/kemitix/mon/MaybeTest.java b/src/test/java/net/kemitix/mon/MaybeTest.java index ecd0190..ba68b3c 100644 --- a/src/test/java/net/kemitix/mon/MaybeTest.java +++ b/src/test/java/net/kemitix/mon/MaybeTest.java @@ -32,6 +32,15 @@ public class MaybeTest { assertThat(nothing()).isSameAs(nothing()); } + @Test + public void equality() { + assertThat(just(1)).isEqualTo(just(1)); + assertThat(just(1)).isNotEqualTo(just(2)); + assertThat(just(1)).isNotEqualTo(nothing()); + assertThat(nothing()).isEqualTo(nothing()); + assertThat(just(1).equals("1")).isFalse(); + } + @Test public void maybeAllowsNull() { assertThat(just(1)).isEqualTo(maybe(1));