2024-01-16 21:26:16 +08:00
|
|
|
/*
|
|
|
|
Language: SubUnit
|
|
|
|
Author: Sergey Bronnikov <sergeyb@bronevichok.ru>
|
|
|
|
Website: https://pypi.org/project/python-subunit/
|
|
|
|
*/
|
|
|
|
|
|
|
|
function subunit(hljs) {
|
|
|
|
const DETAILS = {
|
2023-12-18 13:12:25 +08:00
|
|
|
className: 'string',
|
2024-01-16 21:26:16 +08:00
|
|
|
begin: '\\[\n(multipart)?',
|
|
|
|
end: '\\]\n'
|
2023-12-18 13:12:25 +08:00
|
|
|
};
|
2024-01-16 21:26:16 +08:00
|
|
|
const TIME = {
|
2023-12-18 13:12:25 +08:00
|
|
|
className: 'string',
|
|
|
|
begin: '\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}\.\\d+Z'
|
|
|
|
};
|
2024-01-16 21:26:16 +08:00
|
|
|
const PROGRESSVALUE = {
|
2023-12-18 13:12:25 +08:00
|
|
|
className: 'string',
|
|
|
|
begin: '(\\+|-)\\d+'
|
|
|
|
};
|
2024-01-16 21:26:16 +08:00
|
|
|
const KEYWORDS = {
|
2023-12-18 13:12:25 +08:00
|
|
|
className: 'keyword',
|
|
|
|
relevance: 10,
|
|
|
|
variants: [
|
2024-01-16 21:26:16 +08:00
|
|
|
{
|
|
|
|
begin: '^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
begin: '^progress(:?)(\\s+)?(pop|push)?'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
begin: '^tags:'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
begin: '^time:'
|
|
|
|
}
|
|
|
|
]
|
2023-12-18 13:12:25 +08:00
|
|
|
};
|
|
|
|
return {
|
2024-01-16 21:26:16 +08:00
|
|
|
name: 'SubUnit',
|
2023-12-18 13:12:25 +08:00
|
|
|
case_insensitive: true,
|
|
|
|
contains: [
|
|
|
|
DETAILS,
|
|
|
|
TIME,
|
|
|
|
PROGRESSVALUE,
|
|
|
|
KEYWORDS
|
|
|
|
]
|
|
|
|
};
|
2024-01-16 21:26:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = subunit;
|