当前位置: 首页>>代码示例>>Golang>>正文


Golang Assertions.Nil方法代码示例

本文整理汇总了Golang中github.com/stretchr/testify/assert.Assertions.Nil方法的典型用法代码示例。如果您正苦于以下问题:Golang Assertions.Nil方法的具体用法?Golang Assertions.Nil怎么用?Golang Assertions.Nil使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/stretchr/testify/assert.Assertions的用法示例。


在下文中一共展示了Assertions.Nil方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: verifyLocalFileFromDefaultAsset

func verifyLocalFileFromDefaultAsset(dir string, assert *assert.Assertions) {
	assert.Nil(verifyLocalFile(dir, "index.html"))
	assert.Nil(verifyLocalFile(dir, "site.js"))
	assert.Nil(verifyLocalFile(dir, "assets/1.txt"))
	assert.Nil(verifyLocalFile(dir, "assets/2.txt"))
	assert.Nil(verifyLocalFile(dir, "assets/more/3.txt"))
	assert.Nil(verifyLocalFile(dir, "assets/four/4.txt"))
	assert.Nil(verifyLocalFile(dir, "assets/fivesix/5.txt"))
	assert.Nil(verifyLocalFile(dir, "assets/fivesix/6.txt"))
}
开发者ID:jeremyje,项目名称:gowebserver,代码行数:10,代码来源:zip_test.go

示例2: runComplianceTest

func runComplianceTest(assert *assert.Assertions, filename string) {
	var testSuites []TestSuite
	data, err := ioutil.ReadFile(filename)
	if assert.Nil(err) {
		err := json.Unmarshal(data, &testSuites)
		if assert.Nil(err) {
			for _, testsuite := range testSuites {
				runTestSuite(assert, testsuite, filename)
			}
		}
	}
}
开发者ID:CNDonny,项目名称:scope,代码行数:12,代码来源:compliance_test.go

示例3: startingPoints

func startingPoints(t *assert.Assertions) ([]*Node, *ItemSets, int) {
	c := &config.Config{}
	i, err := NewItemSets(c, NewIntLoader)
	t.Nil(err)
	N, err := i.Loader().(*IntLoader).startingPoints(iterItems(items), 3)
	t.Nil(err)
	nodes := make([]*Node, 0, len(N))
	for _, node := range N {
		n := node.(*Node)
		nodes = append(nodes, n)
		t.True(len(n.txs) >= 3, "len(n.txs) %d < 3", len(n.txs))
	}
	return nodes, i, 3
}
开发者ID:timtadh,项目名称:sfp,代码行数:14,代码来源:itemset_test.go

示例4: deleteAllViaService

func deleteAllViaService(db neoutils.CypherRunner, assert *assert.Assertions, annotationsRW annotations.Service) {
	_, err := annotationsRW.Delete(contentUUID)
	assert.Nil(err)

	qs := []*neoism.CypherQuery{
		{
			Statement: fmt.Sprintf("MATCH (c:Thing {uuid: '%v'})-[rel]-(o) DELETE c, rel ", contentUUID),
		},
		{
			Statement: fmt.Sprintf("MATCH (c:Thing {uuid: '%v'}) DELETE c ", contentUUID),
		},
	}

	err = db.CypherBatch(qs)
	assert.NoError(err)
}
开发者ID:Financial-Times,项目名称:organisations-rw-neo4j,代码行数:16,代码来源:service_concording_scenarios_test.go

示例5: runTestCase

func runTestCase(assert *assert.Assertions, given interface{}, testcase TestCase, filename string) {
	lexer := NewLexer()
	var err error
	_, err = lexer.tokenize(testcase.Expression)
	if err != nil {
		errMsg := fmt.Sprintf("(%s) Could not lex expression: %s -- %s", filename, testcase.Expression, err.Error())
		assert.Fail(errMsg)
		return
	}
	parser := NewParser()
	_, err = parser.Parse(testcase.Expression)
	if err != nil {
		errMsg := fmt.Sprintf("(%s) Could not parse expression: %s -- %s", filename, testcase.Expression, err.Error())
		assert.Fail(errMsg)
		return
	}
	actual, err := Search(testcase.Expression, given)
	if assert.Nil(err, fmt.Sprintf("Expression: %s", testcase.Expression)) {
		assert.Equal(testcase.Result, actual, fmt.Sprintf("Expression: %s", testcase.Expression))
	}
}
开发者ID:CNDonny,项目名称:scope,代码行数:21,代码来源:compliance_test.go

示例6: assertInputNotInStore

func assertInputNotInStore(input string, ref ref.Ref, s ChunkStore, assert *assert.Assertions) {
	data := s.Get(ref)
	assert.Nil(data, "Shouldn't have gotten data for %s", ref.String())
}
开发者ID:arv,项目名称:noms-old,代码行数:4,代码来源:test_utils.go

示例7: assertGetNoExist

func assertGetNoExist(a *assert.Assertions, s KVStore, schema string, key string) {
	val, exist, err := s.Get(schema, key)
	a.NoError(err)
	a.False(exist)
	a.Nil(val)
}
开发者ID:cosminrentea,项目名称:guble,代码行数:6,代码来源:common_test.go


注:本文中的github.com/stretchr/testify/assert.Assertions.Nil方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。