diff options
author | Fabian Henneke <fabian@henneke.me> | 2020-04-15 19:09:51 +0200 |
---|---|---|
committer | Harsh Shandilya <me@msfjarvis.dev> | 2020-04-15 22:47:41 +0530 |
commit | 2a6326ec0ea04ceade7e56749b4cd09f810a34a7 (patch) | |
tree | 7014bb293c020b1788812c5e2a93d23a80ebd074 /app/src/androidTest | |
parent | 7cd6f1d1cf78f60cf187d23469934c83915c778d (diff) |
Address review comments
Diffstat (limited to 'app/src/androidTest')
-rw-r--r-- | app/src/androidTest/java/com/zeapo/pwdstore/StrictDomainRegexTest.kt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/src/androidTest/java/com/zeapo/pwdstore/StrictDomainRegexTest.kt b/app/src/androidTest/java/com/zeapo/pwdstore/StrictDomainRegexTest.kt index c6fa1051..951ff0a1 100644 --- a/app/src/androidTest/java/com/zeapo/pwdstore/StrictDomainRegexTest.kt +++ b/app/src/androidTest/java/com/zeapo/pwdstore/StrictDomainRegexTest.kt @@ -7,42 +7,42 @@ package com.zeapo.pwdstore import kotlin.test.assertFalse import kotlin.test.assertNull import kotlin.test.assertTrue -import org.junit.Test as test +import org.junit.Test private infix fun String.matchedForDomain(domain: String) = SearchableRepositoryViewModel.generateStrictDomainRegex(domain)?.containsMatchIn(this) == true class StrictDomainRegexTest { - @test fun acceptsLiteralDomain() { + @Test fun acceptsLiteralDomain() { assertTrue("work/example.org/john.doe@example.org.gpg" matchedForDomain "example.org") assertTrue("example.org/john.doe@example.org.gpg" matchedForDomain "example.org") assertTrue("example.org.gpg" matchedForDomain "example.org") } - @test fun acceptsSubdomains() { + @Test fun acceptsSubdomains() { assertTrue("work/www.example.org/john.doe@example.org.gpg" matchedForDomain "example.org") assertTrue("www2.example.org/john.doe@example.org.gpg" matchedForDomain "example.org") assertTrue("www.login.example.org.gpg" matchedForDomain "example.org") } - @test fun rejectsPhishingAttempts() { + @Test fun rejectsPhishingAttempts() { assertFalse("example.org.gpg" matchedForDomain "xample.org") assertFalse("login.example.org.gpg" matchedForDomain "xample.org") assertFalse("example.org/john.doe@exmple.org.gpg" matchedForDomain "xample.org") assertFalse("example.org.gpg" matchedForDomain "e/xample.org") } - @test fun rejectNonGpgComponentMatches() { + @Test fun rejectNonGpgComponentMatches() { assertFalse("work/example.org" matchedForDomain "example.org") } - @test fun rejectsEmailAddresses() { + @Test fun rejectsEmailAddresses() { assertFalse("work/notexample.org/john.doe@example.org.gpg" matchedForDomain "example.org") assertFalse("work/notexample.org/john.doe@www.example.org.gpg" matchedForDomain "example.org") assertFalse("work/john.doe@www.example.org/foo.org" matchedForDomain "example.org") } - @test fun rejectsPathSeparators() { + @Test fun rejectsPathSeparators() { assertNull(SearchableRepositoryViewModel.generateStrictDomainRegex("ex/ample.org")) } } |