1 # This file is part of NIT ( http://www.nitlanguage.org ).
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 module test_commands_md
is test
18 intrude import doc
::commands
::commands_main
19 import doc
::commands
::commands_md
25 fun print_md
(md
: nullable Writable) do
26 if md
== null then return
32 fun test_cmd_entity
is test
do
33 var cmd
= new CmdEntity(test_model
, mentity_name
= "test_prog::Character")
38 fun test_cmd_comment
is test
do
39 var cmd
= new CmdComment(test_model
, mentity_name
= "test_prog::Character")
44 fun test_cmd_link
is test
do
45 var cmd
= new CmdEntityLink(test_model
, mentity_name
= "test_prog::Character")
52 fun test_cmd_parents
is test
do
53 var cmd
= new CmdParents(test_model
, test_main
, mentity_name
= "test_prog::Warrior")
58 fun test_cmd_ancestors
is test
do
59 var cmd
= new CmdAncestors(test_model
, test_main
, mentity_name
= "test_prog::Warrior", parents
= false)
64 fun test_cmd_children
is test
do
65 var cmd
= new CmdChildren(test_model
, test_main
, mentity_name
= "test_prog::Career")
70 fun test_cmd_descendants
is test
do
71 var cmd
= new CmdDescendants(test_model
, test_main
, mentity_name
= "test_prog::Career")
78 fun test_cmd_search
is test
do
79 var cmd
= new CmdSearch(test_model
, query
= "Carer", limit
= 10)
86 fun test_cmd_features
is test
do
87 var cmd
= new CmdFeatures(test_model
, mentity_name
= "test_prog::Career")
94 fun test_cmd_lin
is test
do
95 var cmd
= new CmdLinearization(test_model
, test_main
, mentity_name
= "init")
102 fun test_cmd_mentities
is test
do
103 var cmd
= new CmdModelEntities(test_model
, kind
= "modules")
110 fun test_cmd_new
is test
do
111 var cmd
= new CmdNew(test_model
, test_builder
, mentity_name
= "test_prog::Character")
116 fun test_cmd_call
is test
do
117 var cmd
= new CmdCall(test_model
, test_builder
, mentity_name
= "strength_bonus")
122 fun test_cmd_return
is test
do
123 var cmd
= new CmdReturn(test_model
, mentity_name
= "test_prog::Character")
128 fun test_cmd_param
is test
do
129 var cmd
= new CmdParam(test_model
, mentity_name
= "test_prog::Character")
136 fun test_cmd_ini_desc
is test
do
137 var cmd
= new CmdIniDescription(test_model
, mentity_name
= "test_prog")
142 fun test_cmd_ini_git
is test
do
143 var cmd
= new CmdIniGitUrl(test_model
, mentity_name
= "test_prog")
148 fun test_cmd_ini_clone
is test
do
149 var cmd
= new CmdIniCloneCommand(test_model
, mentity_name
= "test_prog")
154 fun test_cmd_ini_issues
is test
do
155 var cmd
= new CmdIniIssuesUrl(test_model
, mentity_name
= "test_prog")
160 fun test_cmd_ini_maintainer
is test
do
161 var cmd
= new CmdIniMaintainer(test_model
, mentity_name
= "test_prog")
166 fun test_cmd_ini_contributors
is test
do
167 var cmd
= new CmdIniContributors(test_model
, mentity_name
= "test_prog")
172 fun test_cmd_ini_license
is test
do
173 var cmd
= new CmdIniLicense(test_model
, mentity_name
= "test_prog")
178 fun test_cmd_ini_license_file
is test
do
179 var cmd
= new CmdLicenseFile(test_model
, mentity_name
= "test_prog")
181 cmd
.file
= cmd
.file
.as(not null).basename
# for testing path
185 fun test_cmd_ini_license_file_content
is test
do
186 var cmd
= new CmdLicenseFileContent(test_model
, mentity_name
= "test_prog")
188 cmd
.file
= cmd
.file
.as(not null).basename
# for testing path
192 fun test_cmd_ini_contrib_file
is test
do
193 var cmd
= new CmdContribFile(test_model
, mentity_name
= "test_prog")
195 cmd
.file
= cmd
.file
.as(not null).basename
# for testing path
199 fun test_cmd_ini_contrib_file_content
is test
do
200 var cmd
= new CmdContribFileContent(test_model
, mentity_name
= "test_prog")
202 cmd
.file
= cmd
.file
.as(not null).basename
# for testing path
208 fun test_cmd_mains
is test
do
209 var cmd
= new CmdMains(test_model
, mentity_name
= "test_prog")
214 fun test_cmd_main_compile
is test
do
215 var cmd
= new CmdMainCompile(test_model
, mentity_name
= "test_prog::test_prog")
220 fun test_cmd_testing
is test
do
221 var cmd
= new CmdTesting(test_model
, mentity_name
= "test_prog")
226 fun test_cmd_man_synopsis
is test
do
227 var cmd
= new CmdManSynopsis(test_model
, mentity_name
= "test_prog")
232 fun test_cmd_man_options
is test
do
233 var cmd
= new CmdManOptions(test_model
, mentity_name
= "test_prog")
240 redef class CmdMainCompile
241 redef fun test_path
(file
) do
242 if file
== null then return null
243 return file
.filename
.basename
248 redef class CmdTesting
249 redef fun test_path
(mentity
) do
250 var file
= mentity
.location
.file
251 if file
== null then return null
252 return file
.filename
.basename