File tree 1 file changed +14
-0
lines changed 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,20 @@ def test_numeric_column_headers():
127
127
assert_equal (result , expected )
128
128
129
129
130
+ def test_88_256_ANSI_color_codes ():
131
+ "Regression: color codes for terminals with 88/256 colors (issue #26)"
132
+ colortable = [('\x1b [48;5;196mred\x1b [49m' ,
133
+ '\x1b [38;5;196mred\x1b [39m' )]
134
+ colorlessheaders = ('background' , 'foreground' )
135
+ formatted = tabulate (colortable , colorlessheaders , 'pipe' )
136
+ expected = "\n " .join ([
137
+ '| background | foreground |' ,
138
+ '|:-------------|:-------------|' ,
139
+ '| \x1b [48;5;196mred\x1b [49m | \x1b [38;5;196mred\x1b [39m |' ])
140
+ print ("expected: %r\n \n got: %r\n " % (expected , formatted ))
141
+ assert_equal (expected , formatted )
142
+
143
+
130
144
def test_column_with_mixed_value_types ():
131
145
"Regression: mixed value types in the same column (issue #31)"
132
146
expected = '\n ' .join ([
You can’t perform that action at this time.
0 commit comments