func TestConfirmLabelDontKnow(t *testing.T) {
df := &utils.DataFile{
Meta: &utils.DataMeta{},
Segments: []*utils.Segment{
{
StartTime: 10.0,
EndTime: 20.0,
Labels: []*utils.Label{
{Species: "Don't Know", Certainty: 0, Filter: "test-filter"},
},
},
},
}
state := NewClassifyState(ClassifyConfig{
Filter: "test-filter",
Reviewer: "David",
Certainty: -1,
}, []*utils.DataFile{df})
// ConfirmLabel on Don't Know should be a no-op
if state.ConfirmLabel() {
t.Error("ConfirmLabel() should return false for Don't Know (certainty=0)")
}
label := df.Segments[0].Labels[0]
if label.Species != "Don't Know" {
t.Errorf("Species should remain Don't Know, got %s", label.Species)
}
if label.Certainty != 0 {
t.Errorf("Certainty should remain 0, got %d", label.Certainty)
}
if state.Dirty {
t.Error("State should not be dirty after confirming Don't Know")
}
}