@@ -36,3 +36,36 @@ schemas:
36
36
assert .Equal (t , "some/random/path" , schemas .Manifest )
37
37
assert .Equal (t , []string {"hello" , "world" }, schemas .Matches )
38
38
}
39
+
40
+ func TestIsPagerEnabled (t * testing.T ) {
41
+ tests := []struct {
42
+ name string
43
+ pager string
44
+ expect bool
45
+ }{
46
+ {"Empty string should enable pager" , "" , true },
47
+ {"'on' should enable pager" , "on" , true },
48
+ {"'less' should enable pager" , "less" , true },
49
+ {"'true' should enable pager" , "true" , true },
50
+ {"'yes' should enable pager" , "yes" , true },
51
+ {"'y' should enable pager" , "y" , true },
52
+ {"'1' should enable pager" , "1" , true },
53
+ {"'off' should disable pager" , "off" , false },
54
+ {"'false' should disable pager" , "false" , false },
55
+ {"'no' should disable pager" , "no" , false },
56
+ {"'n' should disable pager" , "n" , false },
57
+ {"'0' should disable pager" , "0" , false },
58
+ {"Random string should disable pager" , "random" , false },
59
+ {"Capitalized 'ON' should disable pager (case sensitive)" , "ON" , false },
60
+ }
61
+
62
+ for _ , tt := range tests {
63
+ t .Run (tt .name , func (t * testing.T ) {
64
+ term := & Terminal {Pager : tt .pager }
65
+ result := term .IsPagerEnabled ()
66
+ if result != tt .expect {
67
+ t .Errorf ("IsPagerEnabled() for Pager=%q: expected %v, got %v" , tt .pager , tt .expect , result )
68
+ }
69
+ })
70
+ }
71
+ }
0 commit comments