1// Copyright 2011 Aaron Jacobs. All Rights Reserved. 2// Author: aaronjjacobs@gmail.com (Aaron Jacobs) 3// 4// Licensed under the Apache License, Version 2.0 (the "License"); 5// you may not use this file except in compliance with the License. 6// You may obtain a copy of the License at 7// 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// See the License for the specific language governing permissions and 14// limitations under the License. 15 16package ogletest 17 18import "github.com/smartystreets/assertions/internal/oglematchers" 19 20// ExpectEq(e, a) is equivalent to ExpectThat(a, oglematchers.Equals(e)). 21func ExpectEq(expected, actual interface{}, errorParts ...interface{}) { 22 expectThat(actual, oglematchers.Equals(expected), 1, errorParts) 23} 24 25// ExpectNe(e, a) is equivalent to 26// ExpectThat(a, oglematchers.Not(oglematchers.Equals(e))). 27func ExpectNe(expected, actual interface{}, errorParts ...interface{}) { 28 expectThat( 29 actual, 30 oglematchers.Not(oglematchers.Equals(expected)), 31 1, 32 errorParts) 33} 34 35// ExpectLt(x, y) is equivalent to ExpectThat(x, oglematchers.LessThan(y)). 36func ExpectLt(x, y interface{}, errorParts ...interface{}) { 37 expectThat(x, oglematchers.LessThan(y), 1, errorParts) 38} 39 40// ExpectLe(x, y) is equivalent to ExpectThat(x, oglematchers.LessOrEqual(y)). 41func ExpectLe(x, y interface{}, errorParts ...interface{}) { 42 expectThat(x, oglematchers.LessOrEqual(y), 1, errorParts) 43} 44 45// ExpectGt(x, y) is equivalent to ExpectThat(x, oglematchers.GreaterThan(y)). 46func ExpectGt(x, y interface{}, errorParts ...interface{}) { 47 expectThat(x, oglematchers.GreaterThan(y), 1, errorParts) 48} 49 50// ExpectGe(x, y) is equivalent to 51// ExpectThat(x, oglematchers.GreaterOrEqual(y)). 52func ExpectGe(x, y interface{}, errorParts ...interface{}) { 53 expectThat(x, oglematchers.GreaterOrEqual(y), 1, errorParts) 54} 55 56// ExpectTrue(b) is equivalent to ExpectThat(b, oglematchers.Equals(true)). 57func ExpectTrue(b interface{}, errorParts ...interface{}) { 58 expectThat(b, oglematchers.Equals(true), 1, errorParts) 59} 60 61// ExpectFalse(b) is equivalent to ExpectThat(b, oglematchers.Equals(false)). 62func ExpectFalse(b interface{}, errorParts ...interface{}) { 63 expectThat(b, oglematchers.Equals(false), 1, errorParts) 64} 65