logtest

package
Version: v0.0.0-...-61e6862 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 15, 2015 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package logtest provides utilities for logging testing.

Index

Constants

This section is empty.

Variables

View Source
var Messages = map[log.Level]string{
	log.Emergency: "Emergency test message",
	log.Alert:     "Alert test message",
	log.Critical:  "Critical test message",
	log.Error:     "Error test message",
	log.Warning:   "Warning test message",
	log.Notice:    "Notice test message",
	log.Info:      "Info test message",
	log.Debug:     "Debug test message",
}

Messages is a map of log messages.

Functions

func AssertContains

func AssertContains(t *testing.T, out *bytes.Buffer, message string)

AssertContains returns true if a buffer contains a line containing message.

func AssertLineCount

func AssertLineCount(t *testing.T, out *bytes.Buffer, expectedCount int)

AssertLineCount returns the number of log line a buffer contains.

func AssertNotContain

func AssertNotContain(t *testing.T, out *bytes.Buffer, message string)

AssertNotContain returns true if a buffer does not contain a line containing message.

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL