-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors_test.go
More file actions
41 lines (32 loc) · 988 Bytes
/
errors_test.go
File metadata and controls
41 lines (32 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// SPDX-License-Identifier: Apache-2.0
// Copyright Contributors to the OpenTimelineIO project
package gotio
import (
"testing"
)
func TestIndexError(t *testing.T) {
err := &IndexError{Index: 5, Size: 3}
expected := "index 5 out of bounds for size 3"
if err.Error() != expected {
t.Errorf("IndexError.Error() = %q, want %q", err.Error(), expected)
}
}
func TestSchemaError(t *testing.T) {
err := &SchemaError{Schema: "Unknown.1", Message: "not registered"}
expected := "schema Unknown.1: not registered"
if err.Error() != expected {
t.Errorf("SchemaError.Error() = %q, want %q", err.Error(), expected)
}
}
func TestTypeMismatchError(t *testing.T) {
err := &TypeMismatchError{Expected: "Clip", Got: "Gap"}
expected := "expected Clip, got Gap"
if err.Error() != expected {
t.Errorf("TypeMismatchError.Error() = %q, want %q", err.Error(), expected)
}
}
func TestErrNotFound(t *testing.T) {
if ErrNotFound == nil {
t.Error("ErrNotFound should not be nil")
}
}