Skip to content

Commit

Permalink
Run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentTreguier committed Jul 31, 2024
1 parent f380759 commit 268c2fb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
23 changes: 22 additions & 1 deletion .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,31 @@ jobs:
name: Fyreplace.libre.aab
path: app/build/outputs/bundle/libreRelease/app-libre-release.aab
if-no-files-found: error
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'

- name: Run tests
run: ./gradlew test

publish:
name: Publish
needs: build
needs:
- build
- test
runs-on: ubuntu-latest
environment: google-play-store
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ package app.fyreplace.fyreplace.test.navigation

import app.fyreplace.fyreplace.ui.views.navigation.Destination
import org.junit.Assert.assertNotEquals
import org.junit.Assert.assertTrue
import org.junit.Test

class DestinationTests {
@Test
fun testDestinationsAreUnique() {
fun `Destinations are unique`() {
for (first in Destination.entries) {
for (second in Destination.entries.filterNot { it == first }) {
assertNotEquals(first.route, second.route)
Expand All @@ -20,12 +19,7 @@ class DestinationTests {
}

@Test
fun testEssentialsAreFewer() {
assertTrue(Destination.Set.topLevel(flatten = false).size < Destination.Set.topLevel(flatten = true).size)
}

@Test
fun testDestinationsDoNotLoop() {
fun `Destinations do not loop`() {
for (destination in Destination.entries) {
assertNotEquals(destination, destination.parent)
assertNotEquals(destination, destination.parent?.parent)
Expand Down

0 comments on commit 268c2fb

Please sign in to comment.