Ejemplo n.º 1
0
// test we can remove an item
func TestRemove(t *testing.T) {
	tio := tio.NewTio("test")
	tio.ItemAdd(testKey, testValue)

	v, _ := tio.ItemFind(testKey)
	if v != testValue {
		t.Error("Expected '%s', got %s", testValue, v)
	}

	tio.ItemRemove(testKey)
	_, exists := tio.ItemFind(testKey)
	if exists != false {
		t.Error("Expected false, got true")
	}
}
Ejemplo n.º 2
0
// test we can find an item
func TestFind(t *testing.T) {
	tio := tio.NewTio("test")
	tio.ItemAdd(testKey, testValue)

	v, _ := tio.ItemFind(testKey)
	if v != testValue {
		t.Error("Expected '%s', got %s", testValue, v)
	}
}