@@ -83,30 +83,58 @@ void main() {
8383 Method invokeTool;
8484 Method invokeToolNoInput;
8585
86- setUp (() {
86+ setUpAll (() {
8787 toolUser = exLibrary.classes.firstWhere ((c) => c.name == 'ToolUser' );
8888 invokeTool =
8989 toolUser.allInstanceMethods.firstWhere ((m) => m.name == 'invokeTool' );
9090 invokeToolNoInput = toolUser.allInstanceMethods
9191 .firstWhere ((m) => m.name == 'invokeToolNoInput' );
9292 packageGraph.allLocalModelElements.forEach ((m) => m.documentation);
9393 });
94- test ("can invoke a tool" , () {
94+ test ('can invoke a tool and pass args and environment' , () {
95+ expect (invokeTool.documentation, contains ('--file=<INPUT_FILE>' ));
9596 expect (
9697 invokeTool.documentation,
9798 contains (
98- '''Args: [--file=<INPUT_FILE>, --special= |\\ []!@#\\ "\'\$ %^&*()_+]''' ));
99+ new RegExp (r'--source=lib[/\\]example\.dart_[0-9]+_[0-9]+, ' )));
100+ expect (
101+ invokeTool.documentation,
102+ contains (new RegExp (
103+ r'--package-path=<PACKAGE_PATH>, ' )));
104+ expect (
105+ invokeTool.documentation, contains ('--package-name=test_package, ' ));
106+ expect (invokeTool.documentation, contains ('--library-name=ex, ' ));
107+ expect (invokeTool.documentation,
108+ contains ('--element-name=ToolUser.invokeTool, ' ));
109+ expect (invokeTool.documentation,
110+ contains (r'''--special= |\[]!@#\"'$%^&*()_+]''' ));
111+ expect (invokeTool.documentation, contains ('INPUT: <INPUT_FILE>' ));
112+ expect (invokeTool.documentation,
113+ contains (new RegExp ('SOURCE_LINE: [0-9]+, ' )));
114+ expect (invokeTool.documentation,
115+ contains (new RegExp ('SOURCE_COLUMN: [0-9]+, ' )));
116+ expect (invokeTool.documentation,
117+ contains (new RegExp (r'SOURCE_PATH: lib[/\\]example\.dart, ' )));
118+ expect (
119+ invokeTool.documentation,
120+ contains (new RegExp (
121+ r'PACKAGE_PATH: <PACKAGE_PATH>, ' )));
122+ expect (
123+ invokeTool.documentation, contains ('PACKAGE_NAME: test_package, ' ));
124+ expect (invokeTool.documentation, contains ('LIBRARY_NAME: ex, ' ));
125+ expect (invokeTool.documentation,
126+ contains ('ELEMENT_NAME: ToolUser.invokeTool}' ));
99127 expect (invokeTool.documentation, contains ('## `Yes it is a [Dog]!`' ));
100128 });
101- test (" can invoke a tool and add a reference link" , () {
129+ test (' can invoke a tool and add a reference link' , () {
102130 expect (invokeTool.documentation,
103131 contains ('Yes it is a [Dog]! Is not a [ToolUser].' ));
104132 expect (invokeTool.documentationAsHtml,
105- contains (r '<a href="ex/ToolUser-class.html">ToolUser</a>' ));
133+ contains ('<a href="ex/ToolUser-class.html">ToolUser</a>' ));
106134 expect (invokeTool.documentationAsHtml,
107135 contains ('<a href="ex/Dog-class.html">Dog</a>' ));
108136 });
109- test (r" can invoke a tool with no $INPUT or args" , () {
137+ test (r' can invoke a tool with no $INPUT or args' , () {
110138 expect (invokeToolNoInput.documentation, contains ('Args: []' ));
111139 expect (invokeToolNoInput.documentation,
112140 isNot (contains ('This text should not appear in the output' )));
0 commit comments