@@ -7,23 +7,23 @@ import (
77
88func TestParseDevScriptTasks_TasksSyntax (t * testing.T ) {
99 expected := []DevScriptTask {
10- {Usage : "task-syntax-1a" },
11- {Usage : "task-syntax-1b" },
12- {Usage : "task-syntax-1c" },
13- {Usage : "task-syntax-2a" },
14- {Usage : "task-syntax-2b" },
15- {Usage : "task-syntax-2c" },
16- {Usage : "task-syntax-3a" },
10+ {Name : "task-syntax-1a" },
11+ {Name : "task-syntax-1b" },
12+ {Name : "task-syntax-1c" },
13+ {Name : "task-syntax-2a" },
14+ {Name : "task-syntax-2b" },
15+ {Name : "task-syntax-2c" },
16+ {Name : "task-syntax-3a" },
1717 }
1818 actual := ParseDevScriptTasks ("./fixtures/tasks_syntax.sh" )
1919 assert .Equal (t , expected , actual )
2020}
2121
2222func TestParseDevScriptTasks_IgnoreTasksStartingWithUnderscore (t * testing.T ) {
2323 expected := []DevScriptTask {
24- {Usage : "task-not-starting-with-underscore" },
25- {Usage : "task-not-starting-with-underscore_" },
26- {Usage : "task-not-starting-with_underscore" },
24+ {Name : "task-not-starting-with-underscore" },
25+ {Name : "task-not-starting-with-underscore_" },
26+ {Name : "task-not-starting-with_underscore" },
2727 // should not be parsed
2828 // {Usage: "_task-without-underscore"},
2929 // {Usage: "__task-without-underscore"},
@@ -35,7 +35,7 @@ func TestParseDevScriptTasks_IgnoreTasksStartingWithUnderscore(t *testing.T) {
3535
3636func TestParseDevScriptTasks_IgnoreCommentedOutTasks (t * testing.T ) {
3737 expected := []DevScriptTask {
38- {Usage : "task" },
38+ {Name : "task" },
3939 // should not be parsed
4040 // {Usage: "task-commented-out"},
4141 }
@@ -46,31 +46,31 @@ func TestParseDevScriptTasks_IgnoreCommentedOutTasks(t *testing.T) {
4646func TestParseDevScriptTasks_TaskCommentsShouldBeParsed (t * testing.T ) {
4747 expected := []DevScriptTask {
4848 {
49- Usage : "one-line-comment-block" ,
50- Short : "one line comment block - 1" ,
49+ Name : "one-line-comment-block" ,
50+ Title : "one line comment block - 1" ,
5151 // TODO: fix trailing \n
52- Long : "one line comment block - 1" ,
52+ Description : "one line comment block - 1" ,
5353 },
5454 {
55- Usage : "multiline-comment-block" ,
56- Short : "multiline comment block - 1" ,
55+ Name : "multiline-comment-block" ,
56+ Title : "multiline comment block - 1" ,
5757 // TODO: fix trailing \n
58- Long : "multiline comment block - 1\n multiline comment block - 2\n multiline comment block - 3" ,
58+ Description : "multiline comment block - 1\n multiline comment block - 2\n multiline comment block - 3" ,
5959 },
6060 {
61- Usage : "empty-lines-in-comment-block" ,
62- Short : "multiline comment block with empty lines - 1" ,
61+ Name : "empty-lines-in-comment-block" ,
62+ Title : "multiline comment block with empty lines - 1" ,
6363 // TODO: fix trailing \n
64- Long : "multiline comment block with empty lines - 1\n \n multiline comment block with empty lines - 2\n \n multiline comment block with empty lines - 3" ,
64+ Description : "multiline comment block with empty lines - 1\n \n multiline comment block with empty lines - 2\n \n multiline comment block with empty lines - 3" ,
6565 },
6666 {
67- Usage : "leading-spaces-or-none-in-comment-block" ,
68- Short : "leading space missing" ,
67+ Name : "leading-spaces-or-none-in-comment-block" ,
68+ Title : "leading space missing" ,
6969 // TODO: fix trailing \n
7070 // remove # and one space always if present
7171 // keep \n but remove spaces if they are the only chars after #
7272 // also keep empty lines
73- Long : "leading space missing\n keep leading-spaces used for indents\n \n \n \n comment block end" ,
73+ Description : "leading space missing\n keep leading-spaces used for indents\n \n \n \n comment block end" ,
7474 },
7575 }
7676 actual := ParseDevScriptTasks ("./fixtures/tasks_with_comments.sh" )
0 commit comments