1 /* 2 * Copyright 2019 Google Inc. All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.google.turbine.processing; 18 19 import static com.google.common.truth.Truth.assertThat; 20 21 import com.google.common.testing.EqualsTester; 22 import org.junit.Test; 23 import org.junit.runner.RunWith; 24 import org.junit.runners.JUnit4; 25 26 @RunWith(JUnit4.class) 27 public class TurbineNameTest { 28 29 @Test equals()30 public void equals() { 31 new EqualsTester() 32 .addEqualityGroup( 33 new TurbineName("hello"), new TurbineName("hello"), new TurbineName("hello")) 34 .addEqualityGroup(new TurbineName("is")) 35 .addEqualityGroup(new TurbineName("there")) 36 .addEqualityGroup(new TurbineName("anybody")) 37 .addEqualityGroup(new TurbineName("in")) 38 .testEquals(); 39 } 40 41 @Test asd()42 public void asd() { 43 assertThat(new TurbineName("hello").contentEquals("hello")).isTrue(); 44 assertThat(new TurbineName("hello").contentEquals("goodbye")).isFalse(); 45 46 assertThat(new TurbineName("hello").length()).isEqualTo(5); 47 48 assertThat(new TurbineName("hello").charAt(0)).isEqualTo('h'); 49 50 assertThat(new TurbineName("hello").subSequence(1, 4).toString()).isEqualTo("ell"); 51 52 assertThat(new TurbineName("hello").toString()).isEqualTo("hello"); 53 } 54 } 55