mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
fix several bugs:
- properly remove the leading non-flag args from the command line before passing the rest to the executor - fix missed "add" after "delete" in merge() when objects are identical - properly test for tombstone instead of *api.Node in delete handler - basic tests for node registrator
This commit is contained in:
@@ -119,6 +119,32 @@ func TestFIFO_addUpdate(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestFIFO_addDeleteAdd(t *testing.T) {
|
||||
f := NewHistorical(nil)
|
||||
testobj := &testObj{"foo", 10}
|
||||
f.Add(testobj)
|
||||
f.Delete(testobj)
|
||||
f.Add(testobj)
|
||||
|
||||
_, exists, _ := f.GetByKey("foo")
|
||||
if !exists {
|
||||
t.Errorf("item did not get readded")
|
||||
}
|
||||
}
|
||||
|
||||
func TestFIFO_addPopAdd(t *testing.T) {
|
||||
f := NewHistorical(nil)
|
||||
testobj := &testObj{"foo", 10}
|
||||
f.Add(testobj)
|
||||
f.Pop(nil)
|
||||
f.Add(testobj)
|
||||
|
||||
_, exists, _ := f.GetByKey("foo")
|
||||
if !exists {
|
||||
t.Errorf("item did not get readded")
|
||||
}
|
||||
}
|
||||
|
||||
func TestFIFO_addReplace(t *testing.T) {
|
||||
f := NewHistorical(nil)
|
||||
f.Add(&testObj{"foo", 10})
|
||||
|
||||
Reference in New Issue
Block a user