ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Color​Scheme​Unit

by gerardroche ST3

Color scheme Sublime Text Unit Testing.

Details

Installs

  • Total 5K
  • Win 4K
  • Mac 519
  • Linux 644
Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6
Windows 0 1 0 0 1 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 2 1 0 0 0 0 0 1 2 1 0 2 1 0 1 0 0 0 0 0 0 2 0 1
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 2 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

ColorSchemeUnit

A testing framework for Sublime Text color schemes.

Continuous Integration codecov Package Control

ColorSchemeUnit

Setup

Install ColorSchemeUnit via Package Control.

Commands

Command Description
ColorSchemeUnit: Test Suite Run test suite of the current file.
ColorSchemeUnit: Test File Run tests for the current file.
ColorSchemeUnit: Show Styles Show styles at the current cursor position.
ColorSchemeUnit: Generate Assertions Generates assertions at the current cursor position.

Key Bindings

Key Description
f4 Jump to Next Failure
shift+f4 Jump to Previous Failure

Settings

Setting Description Type Default
color_scheme_unit.coverage Enable coverage report. boolean false
color_scheme_unit.debug Enable debug messages. boolean false

Menu → Preferences → Settings

"color_scheme_unit.debug": true,
"color_scheme_unit.coverage": true,

Usage

Tests are similar to Sublime Text syntax tests. Here is an

// COLOR SCHEME TEST "MonokaiFree.sublime-color-scheme" "C"

#include <windows.h>
// ^^^^^ fg=#f92672 fs=
//       ^^^^^^^^^^^ fg=#e6db74 fs=

typedef int myint;
// ^^^^ fg=#66d9ef fs=italic
//      ^^^ fg=#66d9ef fs=italic
//          ^^^^^ fg=#a6e22e fs=
//               ^ fg=#f8f8f2 fs=

Tests

File names

Test must begin color_scheme_test e.g. color_scheme_test.css, color_scheme_test.php, color_scheme_test.rb.

The recommended package layout:

.
├── Monokai.sublime-color-scheme
└── tests/
  ├── color_scheme_test.css
  ├── color_scheme_test.php
  ├── color_scheme_test.rb
  └── ...

Headers

The first line must start:

<begin-comment> COLOR SCHEME TEST "<color-scheme>" "<syntax>"
Parameter Description
<begin-comment> Any syntax comment e.g. //,

<!DOCTYPE html>

<meta charset="utf-8">






</head>
<body>
    <p class="title" id='title'>Title</p>











</body>

#### PHP example

```php
<?php // COLOR SCHEME TEST "MonokaiFree.sublime-color-scheme" "PHP"

use \Psr\Http\Message\ServerRequestInterface as Request;
//^ fg=#f92672 fs=
//  ^^^^^^^^^^^^^^^^^^ fg=#f8f8f2 fs=
//                    ^^^^^^^^^^^^^^^^^^^^^^ fg=#66d9ef fs=italic
//                                           ^^ fg=#f92672 fs=
//                                              ^^^^^^^ fg=#a6e22e fs=
//                                                     ^ fg=#f8f8f2 fs=
use \Psr\Http\Message\ResponseInterface as Response;
//^ fg=#f92672 fs=
//  ^^^^^^^^^^^^^^^^^^ fg=#f8f8f2 fs=
//                    ^^^^^^^^^^^^^^^^^ fg=#66d9ef fs=italic
//                                      ^^ fg=#f92672 fs=
//                                         ^^^^^^^^ fg=#a6e22e fs=
//                                                 ^ fg=#f8f8f2 fs=

require 'vendor/autoload.php';
// ^^^^ fg=#f92672 fs=
//      ^^^^^^^^^^^^^^^^^^^^^ fg=#e6db74 fs=
//                           ^ fg=#f8f8f2 fs=

CI

To run tests in CI see UnitTesting documentation.

Changelog

See CHANGELOG.md.

License

Released under the GPL-3.0-or-later License.