diff options
author | danglotb <bdanglot@gmail.com> | 2018-08-10 09:47:04 +0200 |
---|---|---|
committer | danglotb <bdanglot@gmail.com> | 2018-08-20 09:46:59 +0200 |
commit | 077bd8c26b4b509807bb3af96cc429e34982d927 (patch) | |
tree | 5f5d136ff5fe945ffc09914bbfaf44b5972eb6e9 /src/test/java/com/squareup/javapoet/NameAllocatorTest.java | |
parent | dfb5bc6c4e0c33f0d40d02c9702089da8a848d2f (diff) | |
download | javapoet-077bd8c26b4b509807bb3af96cc429e34982d927.tar.gz |
test: specify more toJavaIdentifier
Diffstat (limited to 'src/test/java/com/squareup/javapoet/NameAllocatorTest.java')
-rw-r--r-- | src/test/java/com/squareup/javapoet/NameAllocatorTest.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/test/java/com/squareup/javapoet/NameAllocatorTest.java b/src/test/java/com/squareup/javapoet/NameAllocatorTest.java index 1840107..71402c6 100644 --- a/src/test/java/com/squareup/javapoet/NameAllocatorTest.java +++ b/src/test/java/com/squareup/javapoet/NameAllocatorTest.java @@ -18,9 +18,11 @@ package com.squareup.javapoet; import org.junit.Test; import static com.google.common.truth.Truth.assertThat; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.fail; public final class NameAllocatorTest { + @Test public void usage() throws Exception { NameAllocator nameAllocator = new NameAllocator(); assertThat(nameAllocator.newName("foo", 1)).isEqualTo("foo"); @@ -59,6 +61,7 @@ public final class NameAllocatorTest { @Test public void characterMappingInvalidStartButValidPart() throws Exception { NameAllocator nameAllocator = new NameAllocator(); assertThat(nameAllocator.newName("1ab", 1)).isEqualTo("_1ab"); + assertThat(nameAllocator.newName("a-1", 2)).isEqualTo("a_1"); } @Test public void characterMappingInvalidStartIsInvalidPart() throws Exception { |