Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Briar Desktop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
Briar Desktop
Commits
dc028e2f
Commit
dc028e2f
authored
3 years ago
by
Sebastian
Committed by
Mikolai Gütschow
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Let CI run tests; add a test for the sake of having one
parent
75dda183
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!73
Let CI run tests; add a test for the sake of having one
Pipeline
#8795
passed
3 years ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+4
-1
4 additions, 1 deletion
.gitlab-ci.yml
src/test/kotlin/org/briarproject/briar/desktop/contact/ContactItemTest.kt
+36
-0
36 additions, 0 deletions
...org/briarproject/briar/desktop/contact/ContactItemTest.kt
with
40 additions
and
1 deletion
.gitlab-ci.yml
+
4
−
1
View file @
dc028e2f
...
...
@@ -12,13 +12,16 @@ workflow:
-
if
:
'
$CI_COMMIT_BRANCH'
-
if
:
'
$CI_COMMIT_TAG'
variables
:
GIT_SUBMODULE_STRATEGY
:
recursive
test
:
stage
:
test
before_script
:
-
set -e
-
export GRADLE_USER_HOME=$PWD/.gradle
script
:
-
./gradlew --no-daemon
ktlintC
heck
-
./gradlew --no-daemon
:c
heck
after_script
:
# these file change every time and should not be cached
-
rm -f $GRADLE_USER_HOME/caches/modules-2/modules-2.lock
...
...
This diff is collapsed.
Click to expand it.
src/test/kotlin/org/briarproject/briar/desktop/contact/ContactItemTest.kt
0 → 100644
+
36
−
0
View file @
dc028e2f
package
org.briarproject.briar.desktop.contact
import
org.briarproject.bramble.api.UniqueId
import
org.briarproject.bramble.api.contact.ContactId
import
org.briarproject.bramble.api.identity.AuthorId
import
kotlin.random.Random
import
kotlin.test.Test
import
kotlin.test.assertEquals
class
ContactItemTest
{
@Test
fun
test
()
{
val
random
=
Random
(
1
)
val
item
=
ContactItem
(
idWrapper
=
RealContactIdWrapper
(
ContactId
(
random
.
nextInt
())),
authorId
=
AuthorId
(
random
.
nextBytes
(
UniqueId
.
LENGTH
)),
name
=
"Alice"
,
alias
=
null
,
isConnected
=
false
,
isEmpty
=
false
,
unread
=
10
,
timestamp
=
random
.
nextLong
()
)
assertEquals
(
"Alice"
,
item
.
displayName
)
val
updated
=
item
.
updateAlias
(
"liz"
)
assertEquals
(
"liz (Alice)"
,
updated
.
displayName
)
// old item did not get updated
assertEquals
(
"Alice"
,
item
.
displayName
)
val
reset
=
updated
.
updateAlias
(
null
)
assertEquals
(
"Alice"
,
reset
.
displayName
)
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment