(t *testing.T)
| 118 | } |
| 119 | |
| 120 | func TestIsAccessibleMode(t *testing.T) { |
| 121 | tests := []struct { |
| 122 | name string |
| 123 | accessible string |
| 124 | term string |
| 125 | noColor string |
| 126 | expected bool |
| 127 | }{ |
| 128 | { |
| 129 | name: "ACCESSIBLE=1 enables accessibility", |
| 130 | accessible: "1", |
| 131 | term: "xterm", |
| 132 | noColor: "", |
| 133 | expected: true, |
| 134 | }, |
| 135 | { |
| 136 | name: "ACCESSIBLE=true enables accessibility", |
| 137 | accessible: "true", |
| 138 | term: "xterm", |
| 139 | noColor: "", |
| 140 | expected: true, |
| 141 | }, |
| 142 | { |
| 143 | name: "ACCESSIBLE with any non-empty value enables accessibility", |
| 144 | accessible: "yes", |
| 145 | term: "xterm", |
| 146 | noColor: "", |
| 147 | expected: true, |
| 148 | }, |
| 149 | { |
| 150 | name: "TERM=dumb enables accessibility", |
| 151 | accessible: "", |
| 152 | term: "dumb", |
| 153 | noColor: "", |
| 154 | expected: true, |
| 155 | }, |
| 156 | { |
| 157 | name: "NO_COLOR=1 enables accessibility", |
| 158 | accessible: "", |
| 159 | term: "xterm", |
| 160 | noColor: "1", |
| 161 | expected: true, |
| 162 | }, |
| 163 | { |
| 164 | name: "NO_COLOR=true enables accessibility", |
| 165 | accessible: "", |
| 166 | term: "xterm", |
| 167 | noColor: "true", |
| 168 | expected: true, |
| 169 | }, |
| 170 | { |
| 171 | name: "normal terminal without any accessibility flags", |
| 172 | accessible: "", |
| 173 | term: "xterm-256color", |
| 174 | noColor: "", |
| 175 | expected: false, |
| 176 | }, |
| 177 | { |
nothing calls this directly
no test coverage detected