44Before (Setup):
55 colorscheme oscura-dusk
66 syntax enable
7-
8- Execute (Basic Color Definitions):
9- let colors = {
7+ " Define expected colors globally for all tests
8+ let g:test_colors = {
109 \ 'bg': '#131419',
1110 \ 'fg': '#E6E6E6',
1211 \ 'comment': '#46474F',
1312 \ 'keyword': '#9099A1',
1413 \ 'function': '#E6E7A3',
15- \ 'string': '#F9B98C'
14+ \ 'string': '#F9B98C',
15+ \ 'number': '#F9B98C',
16+ \ 'constant': '#F9B98C',
17+ \ 'type': '#E6E7A3',
18+ \ 'error': '#FF5C5C',
19+ \ 'warning': '#D2D714',
20+ \ 'special': '#9592A4',
21+ \ 'visual': '#232323',
22+ \ 'cursor': '#FFCC00',
23+ \ 'selection': '#5A5B63',
24+ \ 'linenum': '#32333B',
25+ \ 'linenum_act': '#E6E6E6',
26+ \ 'matchbracket': '#5C6974',
27+ \ 'search': '#5C6974',
28+ \ 'diffadd': '#4EBE96',
29+ \ 'diffdelete': '#FF5C5C',
30+ \ 'diffchange': '#4EBE96',
31+ \ 'difftext': '#303030',
32+ \ 'link': '#479FFA',
33+ \ 'attr': '#54C0A3'
1634 \ }
17-
35+
36+ Execute (Basic Color Definitions):
1837 " Test background color
1938 let bg_color = synIDattr(hlID('Normal'), 'bg#')
20- Assert bg_color ==# colors .bg, 'Background color should be '.colors .bg.' but got '.bg_color
39+ Assert bg_color ==# g:test_colors .bg, 'Background color should be '.g:test_colors .bg.' but got '.bg_color
2140
2241 " Test foreground color
2342 let fg_color = synIDattr(hlID('Normal'), 'fg#')
24- Assert fg_color ==# colors .fg, 'Foreground color should be '.colors .fg.' but got '.fg_color
43+ Assert fg_color ==# g:test_colors .fg, 'Foreground color should be '.g:test_colors .fg.' but got '.fg_color
2544
2645Execute (Syntax Highlighting):
2746 " Test comment highlighting
2847 let comment_color = synIDattr(hlID('Comment'), 'fg#')
29- Assert comment_color ==# colors .comment, 'Comment color should be '.colors .comment
48+ Assert comment_color ==# g:test_colors .comment, 'Comment color should be '.g:test_colors .comment.' but got '.comment_color
3049
3150 " Test function highlighting
3251 let func_color = synIDattr(hlID('Function'), 'fg#')
33- Assert func_color ==# colors.function, 'Function color should be '.colors.function
52+ Assert func_color ==# g:test_colors.function, 'Function color should be '.g:test_colors.function.' but got '.func_color
53+
54+ " Test string highlighting
55+ let string_color = synIDattr(hlID('String'), 'fg#')
56+ Assert string_color ==# g:test_colors.string, 'String color should be '.g:test_colors.string.' but got '.string_color
3457
3558Execute (TypeScript Support):
3659 " Test TypeScript specific highlights
37- let ts_keyword = synIDattr(hlID('typescriptKeyword '), 'fg#')
38- Assert ts_keyword ==# colors.keyword , 'TypeScript keyword color should be '.colors.keyword
60+ let ts_braces = synIDattr(hlID('typescriptBraces '), 'fg#')
61+ Assert ts_braces ==# g:test_colors.special , 'TypeScript braces color should be '.g:test_colors.special.' but got '.ts_braces
3962
4063 let ts_func = synIDattr(hlID('typescriptFuncName'), 'fg#')
41- Assert ts_func ==# colors.function, 'TypeScript function name color should be '.colors.function
64+ Assert ts_func ==# g:test_colors.function, 'TypeScript function name color should be '.g:test_colors.function.' but got '.ts_func
65+
66+ let ts_keyword = synIDattr(hlID('typescriptImport'), 'fg#')
67+ Assert ts_keyword ==# g:test_colors.keyword, 'TypeScript import keyword color should be '.g:test_colors.keyword.' but got '.ts_keyword
4268
4369Execute (UI Elements):
4470 " Test UI elements like status line, line numbers, etc.
4571 let line_nr = synIDattr(hlID('LineNr'), 'fg#')
46- Assert line_nr ==# '#32333B', 'Line number color should be #32333B'
72+ Assert line_nr ==# g:test_colors.linenum, 'Line number color should be '.g:test_colors.linenum.' but got '.line_nr
73+
74+ let cursor_line_nr = synIDattr(hlID('CursorLineNr'), 'fg#')
75+ Assert cursor_line_nr ==# g:test_colors.linenum_act, 'Active line number color should be '.g:test_colors.linenum_act.' but got '.cursor_line_nr
4776
4877 let cursor_line_bg = synIDattr(hlID('CursorLine'), 'bg#')
49- Assert cursor_line_bg ==# '#232323', 'Cursor line background should be #232323'
78+ Assert cursor_line_bg ==# '#232323', 'Cursor line background should be #232323 but got '.cursor_line_bg
5079
51- Execute (Special Highlights):
52- " Test special syntax elements
53- let string_color = synIDattr(hlID('String'), 'fg#')
54- Assert string_color ==# colors.string, 'String color should be '.colors.string
55-
56- " Test if italic style is applied to comments
57- let comment_style = synIDattr(hlID('Comment'), 'italic')
58- Assert comment_style == 1, 'Comments should be italic'
59-
60- Execute (Terminal Colors):
61- if has('nvim')
62- " Test terminal colors in Neovim
63- Assert g:terminal_color_0 ==# colors.bg, 'Terminal color 0 should match background'
64- Assert g:terminal_color_7 ==# colors.fg, 'Terminal color 7 should match foreground'
65- endif
80+ Execute (Search and Visual):
81+ " Test search highlighting
82+ let search_bg = synIDattr(hlID('Search'), 'bg#')
83+ Assert search_bg ==# g:test_colors.search, 'Search highlight background should be '.g:test_colors.search.' but got '.search_bg
84+
85+ " Test visual selection
86+ let visual_bg = synIDattr(hlID('Visual'), 'bg#')
87+ Assert visual_bg ==# g:test_colors.visual, 'Visual selection background should be '.g:test_colors.visual.' but got '.visual_bg
88+
89+ Execute (Diff Colors):
90+ " Test diff highlighting
91+ let diff_add = synIDattr(hlID('DiffAdd'), 'bg#')
92+ Assert diff_add ==# g:test_colors.diffadd, 'DiffAdd background should be '.g:test_colors.diffadd.' but got '.diff_add
93+
94+ " Note: DiffDelete may not be explicitly defined in oscura-dusk, skip this test
95+ " let diff_delete = synIDattr(hlID('DiffDelete'), 'fg#')
96+ " Assert diff_delete ==# g:test_colors.diffdelete, 'DiffDelete foreground should be '.g:test_colors.diffdelete.' but got '.diff_delete
0 commit comments