Skip to content

Commit

Permalink
chore: add cover for 17d7b5c
Browse files Browse the repository at this point in the history
  • Loading branch information
go-coverage-action committed May 22, 2024
1 parent 0254c11 commit 90dbca3
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 9 deletions.
10 changes: 5 additions & 5 deletions go-test-app-01/head/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>cointoss: Go Coverage Report</title>
<script src="../index.js?2c465ea2e74836ac3e4f624ff6086060"></script>
<script src="../index.js?051cc5cf91bdb3d0065a198fc178cfe0"></script>
</head>
<body>
<div id="topbar">
Expand Down Expand Up @@ -47,10 +47,10 @@
const side = "right"

func main() <span class="cov8" title="1">{
if tossCoin() == "heads" </span><span class="cov8" title="1">{
if tossCoin() == "heads" </span><span class="cov0" title="0">{


fmt.Println("Heads") }</span> else<span class="cov0" title="0"> { fmt.Println(`
fmt.Println("Heads") }</span> else<span class="cov8" title="1"> { fmt.Println(`
Tails`) }</span>

<span class="cov8" title="1">printColor("red")
Expand All @@ -60,9 +60,9 @@
}

func tossCoin() string <span class="cov8" title="1">{
if rand.Intn(2) == 0 </span><span class="cov8" title="1">{
if rand.Intn(2) == 0 </span><span class="cov0" title="0">{
return "heads"
}</span> else<span class="cov0" title="0"> {
}</span> else<span class="cov8" title="1"> {
return "tails"
}</span>
}
Expand Down
8 changes: 4 additions & 4 deletions go-test-app-01/head/head.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
mode: set
cointoss/foo.go:3.19,5.2 1 1
cointoss/main.go:10.13,11.27 1 1
cointoss/main.go:11.27,14.37 1 1
cointoss/main.go:14.42,15.25 1 0
cointoss/main.go:11.27,14.37 1 0
cointoss/main.go:14.42,15.25 1 1
cointoss/main.go:17.2,20.28 3 1
cointoss/main.go:23.24,24.23 1 1
cointoss/main.go:24.23,26.3 1 1
cointoss/main.go:26.8,28.3 1 0
cointoss/main.go:24.23,26.3 1 0
cointoss/main.go:26.8,28.3 1 1
cointoss/main.go:31.19,32.21 1 1
cointoss/main.go:32.21,34.3 1 1
cointoss/main.go:34.8,36.3 1 0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>cointoss: Go Coverage Report</title>
<script src="../index.js?051cc5cf91bdb3d0065a198fc178cfe0"></script>
</head>
<body>
<div id="topbar">
<div id="nav">
<select id="files">

<option value="file0">cointoss/main.go (50.0%)</option>

</select>
</div>
<div id="legend">
<span>not tracked</span>

<span class="cov0">not covered</span>
<span class="cov8">covered</span>

</div>
</div>
<div id="content">

<pre class="file" id="file0" style="display: none">package main

import (
"fmt"
"math/rand"
)

const side = "right"

func main() {
if tossCoin() == "heads" <span class="cov0" title="0">{


fmt.Println("Heads") }</span> else<span class="cov8" title="1"> { fmt.Println(`
Tails`) }</span>

printColor("red")

fmt.Println("Maybe:", maybe())
fmt.Println("Foo:", foo())
}

func tossCoin() string {
if rand.Intn(2) == 0 <span class="cov0" title="0">{
return "heads"
}</span> else<span class="cov8" title="1"> {
return "tails"
}</span>
}

func maybe() bool {
if side == "right" {
return true
} else {
return false
}
}

func printColor(color string) {
switch color {
case "red": fmt.Println("Red")
case "blue": fmt.Println("Blue")
case "green": fmt.Println("Green")
default: fmt.Println("Unknown color")
}
}
</pre>

</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mode: set
cointoss/main.go:11.27,14.37 1 0
cointoss/main.go:14.42,15.25 1 1
cointoss/main.go:24.23,26.3 1 0
cointoss/main.go:26.8,28.3 1 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cointoss/main.go:10: main 50.0%
cointoss/main.go:23: tossCoin 50.0%
cointoss/main.go:31: maybe 0.0%
cointoss/main.go:39: printColor 0.0%
total: (statements) 50.0%
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<title>cointoss: Go Coverage Report</title>
<script src="../index.js?051cc5cf91bdb3d0065a198fc178cfe0"></script>
</head>
<body>
<div id="topbar">
<div id="nav">
<select id="files">

<option value="file0">cointoss/foo.go (100.0%)</option>

<option value="file1">cointoss/main.go (64.7%)</option>

</select>
</div>
<div id="legend">
<span>not tracked</span>

<span class="cov0">not covered</span>
<span class="cov8">covered</span>

</div>
</div>
<div id="content">

<pre class="file" id="file0" style="display: none">package main

func foo() string <span class="cov8" title="1">{
return "foo"
}</span>
</pre>

<pre class="file" id="file1" style="display: none">package main

import (
"fmt"
"math/rand"
)

const side = "right"

func main() <span class="cov8" title="1">{
if tossCoin() == "heads" </span><span class="cov0" title="0">{


fmt.Println("Heads") }</span> else<span class="cov8" title="1"> { fmt.Println(`
Tails`) }</span>

<span class="cov8" title="1">printColor("red")

fmt.Println("Maybe:", maybe())
fmt.Println("Foo:", foo())</span>
}

func tossCoin() string <span class="cov8" title="1">{
if rand.Intn(2) == 0 </span><span class="cov0" title="0">{
return "heads"
}</span> else<span class="cov8" title="1"> {
return "tails"
}</span>
}

func maybe() bool <span class="cov8" title="1">{
if side == "right" </span><span class="cov8" title="1">{
return true
}</span> else<span class="cov0" title="0"> {
return false
}</span>
}

func printColor(color string) <span class="cov8" title="1">{
switch color </span>{
case "red":<span class="cov8" title="1"> fmt.Println("Red")</span>
case "blue":<span class="cov0" title="0"> fmt.Println("Blue")</span>
case "green":<span class="cov0" title="0"> fmt.Println("Green")</span>
default:<span class="cov0" title="0"> fmt.Println("Unknown color")</span>
}
}
</pre>

</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
mode: set
cointoss/foo.go:3.19,5.2 1 1
cointoss/main.go:10.13,11.27 1 1
cointoss/main.go:11.27,14.37 1 0
cointoss/main.go:14.42,15.25 1 1
cointoss/main.go:17.2,20.28 3 1
cointoss/main.go:23.24,24.23 1 1
cointoss/main.go:24.23,26.3 1 0
cointoss/main.go:26.8,28.3 1 1
cointoss/main.go:31.19,32.21 1 1
cointoss/main.go:32.21,34.3 1 1
cointoss/main.go:34.8,36.3 1 0
cointoss/main.go:39.31,40.15 1 1
cointoss/main.go:41.13,41.32 1 1
cointoss/main.go:42.14,42.34 1 0
cointoss/main.go:43.15,43.36 1 0
cointoss/main.go:44.10,44.39 1 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cointoss/foo.go:3: foo 100.0%
cointoss/main.go:10: main 83.3%
cointoss/main.go:23: tossCoin 66.7%
cointoss/main.go:31: maybe 66.7%
cointoss/main.go:39: printColor 40.0%
total: (statements) 66.7%

0 comments on commit 90dbca3

Please sign in to comment.