Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ class CliGitClientTest {

This is a commit body

"""
"""
.trimIndent(),
mapOf("Co-authored-by" to "Michael Sims"),
DEFAULT_COMMITTER,
Expand Down
192 changes: 96 additions & 96 deletions git-jaspr/src/test/kotlin/sims/michael/gitjaspr/CommitParsersTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ class CommitParsersTest {
fun `getSubjectAndBodyFromFullMessage - subject and body`() {
val message =
"""
This is a subject
This is a body
This is a subject

This is a body

"""
.trimIndent()

Expand All @@ -47,12 +47,12 @@ class CommitParsersTest {
fun `getSubjectAndBodyFromFullMessage - multiline subject`() {
val message =
"""
This is a subject
with three lines
but still a subject
This is a body
This is a subject
with three lines
but still a subject

This is a body

"""
.trimIndent()

Expand All @@ -79,9 +79,9 @@ class CommitParsersTest {
fun `getFooters - subject and body only`() {
val message =
"""
This is a subject
This is a subject

This is a body
This is a body

"""
.trimIndent()
Expand All @@ -93,12 +93,12 @@ class CommitParsersTest {
fun `getFooters - subject, body with footer-like lines`() {
val message =
"""
This is a subject
This is a subject

This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two
This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two

"""
.trimIndent()
Expand All @@ -110,10 +110,10 @@ class CommitParsersTest {
fun `getFooters - subject, body url that could look like a footer line if your code was bad`() {
val message =
"""
This is a subject
This is a subject

See this Slack thread:
https://trillianthealth.slack.com/archives/C04J6Q655GR/p1702918943374039?thread_ts=1702918322.439999&cid=C04J6Q655GR
See this Slack thread:
https://trillianthealth.slack.com/archives/C04J6Q655GR/p1702918943374039?thread_ts=1702918322.439999&cid=C04J6Q655GR

"""
.trimIndent()
Expand All @@ -125,15 +125,15 @@ class CommitParsersTest {
fun `getFooters - subject, body, existing footer lines`() {
val message =
"""
This is a subject
This is a subject

This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two

This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two

key-one: value-three
key-two: value-four
key-one: value-three
key-two: value-four

"""
.trimIndent()
Expand All @@ -148,15 +148,15 @@ class CommitParsersTest {
fun `getFooters - subject, body, existing footer lines with multiples - last one wins`() {
val message =
"""
This is a subject
This is a subject

This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two

This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two

key-one: value-three
key-one: value-four
key-one: value-three
key-one: value-four

"""
.trimIndent()
Expand All @@ -172,7 +172,7 @@ class CommitParsersTest {

Co-authored-by: John Carmack <jcarmack@idsoftware.com>
commit-id: I0e9e0b26
"""
"""
.trimIndent()

assertEquals(
Expand All @@ -191,7 +191,7 @@ class CommitParsersTest {
This is a commit subject

keys with spaces are not allowed: value
"""
"""
.trimIndent()

assertEquals(emptyMap(), getFooters(message))
Expand All @@ -201,9 +201,9 @@ class CommitParsersTest {
fun `addFooters - subject only`() {
assertEquals(
"""
This is a subject
key1: value1
This is a subject

key1: value1

"""
.trimIndent(),
Expand All @@ -215,9 +215,9 @@ class CommitParsersTest {
fun `addFooters - subject with newline`() {
assertEquals(
"""
This is a subject
key1: value1
This is a subject

key1: value1

"""
.trimIndent(),
Expand All @@ -229,9 +229,9 @@ class CommitParsersTest {
fun `addFooters - subject and body only`() {
val message =
"""
This is a subject
This is a subject

This is a body
This is a body

"""
.trimIndent()
Expand All @@ -241,7 +241,7 @@ class CommitParsersTest {
This is a subject

This is a body

key1: value1

"""
Expand All @@ -254,12 +254,12 @@ class CommitParsersTest {
fun `addFooters - subject, body with footer-like lines`() {
val message =
"""
This is a subject
This is a subject

This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two
This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two

"""
.trimIndent()
Expand All @@ -272,7 +272,7 @@ class CommitParsersTest {
The following are still part of the body:
key-one: value-one
key-two: value-two

key1: value1

"""
Expand All @@ -285,15 +285,15 @@ class CommitParsersTest {
fun `addFooters - subject, body, existing footer lines`() {
val message =
"""
This is a subject
This is a subject

This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two
key-one: value-three
key-two: value-four
This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two

key-one: value-three
key-two: value-four

"""
.trimIndent()
Expand All @@ -306,7 +306,7 @@ class CommitParsersTest {
The following are still part of the body:
key-one: value-one
key-two: value-two

key-one: value-three
key-two: value-four
key1: value1
Expand All @@ -321,15 +321,15 @@ class CommitParsersTest {
fun `addFooters - subject, body, existing footer lines with multiples - last one wins`() {
val message =
"""
This is a subject
This is a subject

This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two

This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two

key-one: value-three
key-one: value-four
key-one: value-three
key-one: value-four

"""
.trimIndent()
Expand Down Expand Up @@ -357,7 +357,7 @@ class CommitParsersTest {
fun `addFooters - subject that looks like a footer line`() {
val message =
"""
Market Explorer: Remove unused code
Market Explorer: Remove unused code

"""
.trimIndent()
Expand All @@ -381,7 +381,7 @@ class CommitParsersTest {
trimFooters(
"""
This is a subject

key1: value1

"""
Expand All @@ -397,7 +397,7 @@ class CommitParsersTest {
trimFooters(
"""
This is a subject

key1: value1

"""
Expand All @@ -410,9 +410,9 @@ class CommitParsersTest {
fun `trimFooters - subject and body only`() {
val message =
"""
This is a subject
This is a subject

This is a body
This is a body

"""
.trimIndent()
Expand All @@ -433,12 +433,12 @@ class CommitParsersTest {
fun `trimFooters - subject, body with footer-like lines`() {
val message =
"""
This is a subject
This is a subject

This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two
This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two

"""
.trimIndent()
Expand All @@ -462,15 +462,15 @@ class CommitParsersTest {
fun `trimFooters - subject, body, existing footer lines`() {
val message =
"""
This is a subject
This is a subject

This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two
key-one: value-three
key-two: value-four
This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two

key-one: value-three
key-two: value-four

"""
.trimIndent()
Expand All @@ -494,15 +494,15 @@ class CommitParsersTest {
fun `trimFooters - subject, body, existing footer lines with multiples - last one wins`() {
val message =
"""
This is a subject
This is a subject

This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two
key-one: value-three
key-one: value-four
This is a body.
The following are still part of the body:
key-one: value-one
key-two: value-two

key-one: value-three
key-one: value-four

"""
.trimIndent()
Expand Down
Loading
Loading