github.com/gogf/gf@v1.16.9/test/gtest/gtest_z_unit_test.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/gogf/gf.
     6  
     7  package gtest_test
     8  
     9  import (
    10  	"testing"
    11  
    12  	"github.com/gogf/gf/test/gtest"
    13  )
    14  
    15  func TestC(t *testing.T) {
    16  	gtest.C(t, func(t *gtest.T) {
    17  		t.Assert(1, 1)
    18  		t.AssertNE(1, 0)
    19  		t.AssertEQ(float32(123.456), float32(123.456))
    20  		t.AssertEQ(float64(123.456), float64(123.456))
    21  	})
    22  }
    23  
    24  func TestCase(t *testing.T) {
    25  	gtest.C(t, func(t *gtest.T) {
    26  		t.Assert(1, 1)
    27  		t.AssertNE(1, 0)
    28  		t.AssertEQ(float32(123.456), float32(123.456))
    29  		t.AssertEQ(float64(123.456), float64(123.456))
    30  	})
    31  }