src/test/kotlin/de/uapcore/lightpit/types/CommitRefTest.kt

changeset 282
c112fad21bf6
parent 280
12b898531d1a
child 288
10324c383126
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/test/kotlin/de/uapcore/lightpit/types/CommitRefTest.kt	Sat Jul 22 13:04:12 2023 +0200
     1.3 @@ -0,0 +1,63 @@
     1.4 +/*
     1.5 + * Copyright 2023 Mike Becker. All rights reserved.
     1.6 + *
     1.7 + * Redistribution and use in source and binary forms, with or without
     1.8 + * modification, are permitted provided that the following conditions are met:
     1.9 + *
    1.10 + * 1. Redistributions of source code must retain the above copyright
    1.11 + * notice, this list of conditions and the following disclaimer.
    1.12 + *
    1.13 + * 2. Redistributions in binary form must reproduce the above copyright
    1.14 + * notice, this list of conditions and the following disclaimer in the
    1.15 + * documentation and/or other materials provided with the distribution.
    1.16 + *
    1.17 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    1.18 + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1.19 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    1.20 + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
    1.21 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
    1.22 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
    1.23 + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    1.24 + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.25 + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    1.26 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    1.27 + *
    1.28 + */
    1.29 +
    1.30 +package de.uapcore.lightpit.types
    1.31 +
    1.32 +import kotlin.test.Test
    1.33 +import kotlin.test.assertContentEquals
    1.34 +
    1.35 +class CommitRefTest {
    1.36 +
    1.37 +    @Test
    1.38 +    fun readCommitLog() {
    1.39 +        assertContentEquals(
    1.40 +            listOf(
    1.41 +                CommitRef("cf9f5982ddeb28c7f695dc547fe73abf5460016f", 50, "here we fix #50"),
    1.42 +                CommitRef("cf9f5982ddeb28c7f695dc547fe73abf5460016f", 30, "here we fix #50"),
    1.43 +                CommitRef(
    1.44 +                    "ed7134e5f4ce278c4f62798fb9f96129be2b132b",
    1.45 +                    1337,
    1.46 +                    "commit with a #non-ref, relates to #wrong ref but still fixes #1337"
    1.47 +                ),
    1.48 +                CommitRef("74d770da3c80c0c3fc1fb7e44fb710d665127dfe", 47, "a change with commitref in body"),
    1.49 +                CommitRef("9a14e5628bdf2d578f3385d78022ddcaf23d1abb", 47, "add test file - relates to #47")
    1.50 +            ),
    1.51 +            parseCommitRefs(
    1.52 +                """::lpitref:cf9f5982ddeb28c7f695dc547fe73abf5460016f:here we fix #50
    1.53 +
    1.54 +and close #30
    1.55 +::lpitref:ed7134e5f4ce278c4f62798fb9f96129be2b132b:commit with a #non-ref, relates to #wrong ref but still fixes #1337
    1.56 +::lpitref:74d770da3c80c0c3fc1fb7e44fb710d665127dfe:a change with commitref in body
    1.57 +
    1.58 +some more details
    1.59 +fixes #47
    1.60 +::lpitref:d533c717dfecb8e4b993ca6c8760f1493bc834b6:no commitref
    1.61 +::lpitref:9a14e5628bdf2d578f3385d78022ddcaf23d1abb:add test file - relates to #47
    1.62 +"""
    1.63 +            )
    1.64 +        )
    1.65 +    }
    1.66 +}
    1.67 \ No newline at end of file

mercurial