(t *testing.T)
| 405 | } |
| 406 | |
| 407 | func TestUtils(t *testing.T) { |
| 408 | res := RandomString(10) |
| 409 | assert.Equal(t, len(res), 10) |
| 410 | |
| 411 | res = ToString("test_string") |
| 412 | assert.Equal(t, res, "\"test_string\"") |
| 413 | |
| 414 | res = ToString(10) |
| 415 | assert.Equal(t, res, "10") |
| 416 | |
| 417 | res = ToString(1.2) |
| 418 | assert.Equal(t, res, "1.2") |
| 419 | |
| 420 | res = ToString(true) |
| 421 | assert.Equal(t, res, "true") |
| 422 | |
| 423 | var arr = []interface{}{1,2,3,"boom"} |
| 424 | res = ToString(arr) |
| 425 | assert.Equal(t, res, "[1,2,3,\"boom\"]") |
| 426 | |
| 427 | jsonMap := make(map[string]interface{}) |
| 428 | jsonMap["object"] = map[string]interface{} {"foo": 1} |
| 429 | res = ToString(jsonMap) |
| 430 | assert.Equal(t, res, "{object: {foo: 1}}") |
| 431 | } |
| 432 | |
| 433 | func TestNodeMapDatatype(t *testing.T) { |
| 434 | graph.Flush() |
nothing calls this directly
no test coverage detected