Skip to content

Commit

Permalink
go: update run-tests output
Browse files Browse the repository at this point in the history
  • Loading branch information
vpayno committed Sep 8, 2023
1 parent 10b87eb commit b44118b
Show file tree
Hide file tree
Showing 492 changed files with 370,753 additions and 22,294 deletions.
4 changes: 2 additions & 2 deletions go/acronym/acronym-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import "acronym"
```

Package acronym converts a phrase to its acronym\. The 1st iteration is better than the second one\.
Package acronym converts a phrase to its acronym. The 1st iteration is better than the second one.

## Index

Expand All @@ -19,7 +19,7 @@ Package acronym converts a phrase to its acronym\. The 1st iteration is better t
func Abbreviate(s string) string
```

Abbreviate returns an acronym from the supplied string\.
Abbreviate returns an acronym from the supplied string.

<details><summary>Example</summary>
<p>
Expand Down
4 changes: 2 additions & 2 deletions go/acronym/acronym-doc.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package acronym // import "acronym"

Package acronym converts a phrase to its acronym. The 1st iteration is
better than the second one.
Package acronym converts a phrase to its acronym. The 1st iteration is better
than the second one.

FUNCTIONS

Expand Down
7 changes: 4 additions & 3 deletions go/acronym/benchstat-new.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
goos: linux
goarch: amd64
pkg: acronym
cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz
BenchmarkAcronym-4 5791 305661 ns/op 30838 B/op 426 allocs/op
cpu: 12th Gen Intel(R) Core(TM) i5-1240P
BenchmarkAcronym
BenchmarkAcronym-8 20481 57491 ns/op 31138 B/op 426 allocs/op
PASS
ok acronym 1.839s
ok acronym 1.718s
4 changes: 2 additions & 2 deletions go/acronym/benchstat-old.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ goos: linux
goarch: amd64
pkg: acronym
cpu: Intel(R) Core(TM) i7-7Y75 CPU @ 1.30GHz
BenchmarkAcronym-4 6241 173929 ns/op 30896 B/op 426 allocs/op
BenchmarkAcronym-4 5791 305661 ns/op 30838 B/op 426 allocs/op
PASS
ok acronym 2.051s
ok acronym 1.839s
39 changes: 39 additions & 0 deletions go/acronym/coverage-annotations.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

11 func Abbreviate(s string) string {
12 var a string
13
14 // Since we can't use cases or language, we have to do some pre-processing.
15 reStr := `(["'_;:.]|[[:digit:]])`
16
17 re, e := regexp.Compile(reStr)
18 if e != nil {
19 // the raw re string is static but you can still make mistakes, better
20 // to panic during tests than quietly "working" incorrectly.
21 MISS panic(e)
22 }
23
24 a = re.ReplaceAllString(s, "")
25
26 // Get the title converted string.
27 // Using deprecated function, the test harness doesn't run `go mod tidy` or
28 // it also lacks Internet access.
29 a = strings.ToLower(a)
30 a = strings.Title(a)
31
32 // Thought about looping through the string to find uppercase letters,
33 // decided on just using regexp to remove everything else instead.
34 // I've tried using the strings IsSomething functions befoer and they're a mess.
35 reStr = `([[:lower:]]|[[:blank:]]|[[:punct:]])`
36
37 re, e = regexp.Compile(reStr)
38 if e != nil {
39 // the raw re string is static but you can still make mistakes, better
40 // to panic during tests than quietly "working" incorrectly.
41 MISS panic(e)
42 }
43
44 a = re.ReplaceAllString(a, "")
45
46 return a
47 }

4 changes: 2 additions & 2 deletions go/acronym/coverage.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mode: count
acronym/acronym.go:11.34,18.14 4 10
acronym/acronym.go:24.2,38.14 6 10
acronym/acronym.go:44.2,46.10 2 10
acronym/acronym.go:18.14,21.11 1 0
acronym/acronym.go:24.2,38.14 6 10
acronym/acronym.go:38.14,41.11 1 0
acronym/acronym.go:44.2,46.10 2 10
Loading

0 comments on commit b44118b

Please sign in to comment.