Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/kr/assert

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/kr/assert

  • v0.0.0-20110608085935-1717361e3117
  • Source
  • Go
  • Socket score

Version published
Created
Source

Assert (c) Blake Mizerany and Keith Rarick -- MIT LICENCE

Assertions for Go tests

Install

$ goinstall github.com/bmizerany/assert

Use

point.go

package point

type Point struct {
    x, y int
}

point_test.go

package point

import (
    "testing"
    "github.com/bmizerany/assert"
)

func TestAsserts(t *testing.T) {
    p1 := Point{1, 1}
    p2 := Point{2, 1}

    assert.Equal(t, p1, p2)
}

output

--- FAIL: point.TestAsserts
        /Users/blake/code/assert/example/point_test.go:12
        !  Expected: point.Point point.Point{x:1, y:1}
        !  Got:      point.Point point.Point{x:2, y:1}
FAIL

Docs

http://github.com/bmizerany/assert

FAQs

Package last updated on 08 Jun 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc