本文整理汇总了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"))
}
示例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)
}
}
}
}
示例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
}
示例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)
}
示例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))
}
}
示例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())
}
示例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)
}