Skip to content

Commit

Permalink
Readme badge (#2)
Browse files Browse the repository at this point in the history
* Build status badge
  • Loading branch information
gammazero authored Jun 4, 2022
1 parent ef46bab commit aa22d7c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 29 deletions.
File renamed without changes.
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# channelqueue
[![GoDoc](https://pkg.go.dev/badge/github.com/gammazero/channelqueue)](https://pkg.go.dev/github.com/gammazero/channelqueue)
[![Build Status](https://github.com/gammazero/channelqueue/actions/workflows/go.yml/badge.svg)](https://github.com/gammazero/channelqueue/actions/workflows/go.yml)
[![Go Report Card](https://goreportcard.com/badge/github.com/gammazero/channelqueue)](https://goreportcard.com/report/github.com/gammazero/channelqueue)
[![codecov](https://codecov.io/gh/gammazero/channelqueue/branch/master/graph/badge.svg)](https://codecov.io/gh/gammazero/channelqueue)
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
Expand Down
20 changes: 17 additions & 3 deletions channelqueue_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package channelqueue

import (
"errors"
"fmt"
"testing"
"time"
)
Expand Down Expand Up @@ -33,6 +35,9 @@ func TestCapLen(t *testing.T) {
}
}()
cq = New[int](0)
if cq != nil {
t.Fatal("expected nil")
}
}

func TestUnlimitedSpace(t *testing.T) {
Expand Down Expand Up @@ -88,6 +93,7 @@ func TestBufferLimit(t *testing.T) {
func TestRace(t *testing.T) {
ch := New[int](-1)

var err error
done := make(chan struct{})
go func() {
for {
Expand All @@ -97,10 +103,10 @@ func TestRace(t *testing.T) {
default:
}
if ch.Len() > 1000 {
t.Fatal("Len too great")
err = errors.New("Len too great")
}
if ch.Cap() != -1 {
t.Fatal("expected Cap to return -1")
err = errors.New("expected Cap to return -1")
}
}
}()
Expand Down Expand Up @@ -132,6 +138,9 @@ func TestRace(t *testing.T) {
if val != 999 {
t.Fatalf("last value should be 999, got %d", val)
}
if err != nil {
t.Fatal(err)
}
}

func TestDouble(t *testing.T) {
Expand All @@ -144,11 +153,13 @@ func TestDouble(t *testing.T) {
}
ch.Close()
}()
var err error
go func() {
for i := 0; i < msgCount; i++ {
val := <-ch.Out()
if i != val {
t.Fatal("expected", i, "but got", val)
err = fmt.Errorf("expected %d but got %d", i, val)
return
}
recvCh.In() <- i
}
Expand All @@ -159,6 +170,9 @@ func TestDouble(t *testing.T) {
t.Fatal("expected", i, "but got", val)
}
}
if err != nil {
t.Fatal(err)
}
}

func BenchmarkSerial(b *testing.B) {
Expand Down
12 changes: 0 additions & 12 deletions go.test.sh

This file was deleted.

0 comments on commit aa22d7c

Please sign in to comment.