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_html
is test
18 intrude import doc
::commands
::commands_main
19 import doc
::commands
::commands_html
21 class TestCommandsHtml
25 fun print_html
(html
: nullable Writable) do
26 if html
== null then return
32 fun test_cmd_entity
is test
do
33 var cmd
= new CmdEntity(test_model
, mentity_name
= "test_prog::Character")
35 print_html cmd
.to_html
38 fun test_cmd_comment
is test
do
39 var cmd
= new CmdComment(test_model
, mentity_name
= "test_prog::Character")
41 print_html cmd
.to_html
44 fun test_cmd_link
is test
do
45 var cmd
= new CmdEntityLink(test_model
, mentity_name
= "test_prog::Character")
47 print_html cmd
.to_html
52 fun test_cmd_parents
is test
do
53 var cmd
= new CmdParents(test_model
, test_main
, mentity_name
= "test_prog::Warrior")
55 print_html cmd
.to_html
58 fun test_cmd_ancestors
is test
do
59 var cmd
= new CmdAncestors(test_model
, test_main
, mentity_name
= "test_prog::Warrior", parents
= false)
61 print_html cmd
.to_html
64 fun test_cmd_children
is test
do
65 var cmd
= new CmdChildren(test_model
, test_main
, mentity_name
= "test_prog::Career")
67 print_html cmd
.to_html
70 fun test_cmd_descendants
is test
do
71 var cmd
= new CmdDescendants(test_model
, test_main
, mentity_name
= "test_prog::Career")
73 print_html cmd
.to_html
78 fun test_cmd_search
is test
do
79 var cmd
= new CmdSearch(test_model
, query
= "Carer", limit
= 10)
81 print_html cmd
.to_html
86 fun test_cmd_features
is test
do
87 var cmd
= new CmdFeatures(test_model
, mentity_name
= "test_prog::Career")
89 print_html cmd
.to_html
94 fun test_cmd_lin
is test
do
95 var cmd
= new CmdLinearization(test_model
, test_main
, mentity_name
= "init")
97 print_html cmd
.to_html
102 fun test_cmd_mentities
is test
do
103 var cmd
= new CmdModelEntities(test_model
, kind
= "modules")
105 print_html cmd
.to_html
110 fun test_cmd_new
is test
do
111 var cmd
= new CmdNew(test_model
, test_builder
, mentity_name
= "test_prog::Character")
113 print_html cmd
.to_html
116 fun test_cmd_call
is test
do
117 var cmd
= new CmdCall(test_model
, test_builder
, mentity_name
= "strength_bonus")
119 print_html cmd
.to_html
122 fun test_cmd_return
is test
do
123 var cmd
= new CmdReturn(test_model
, mentity_name
= "test_prog::Character")
125 print_html cmd
.to_html
128 fun test_cmd_param
is test
do
129 var cmd
= new CmdParam(test_model
, mentity_name
= "test_prog::Character")
131 print_html cmd
.to_html
136 fun test_cmd_ini_desc
is test
do
137 var cmd
= new CmdIniDescription(test_model
, mentity_name
= "test_prog")
139 print_html cmd
.to_html
142 fun test_cmd_ini_git
is test
do
143 var cmd
= new CmdIniGitUrl(test_model
, mentity_name
= "test_prog")
145 print_html cmd
.to_html
148 fun test_cmd_ini_clone
is test
do
149 var cmd
= new CmdIniCloneCommand(test_model
, mentity_name
= "test_prog")
151 print_html cmd
.to_html
154 fun test_cmd_ini_issues
is test
do
155 var cmd
= new CmdIniIssuesUrl(test_model
, mentity_name
= "test_prog")
157 print_html cmd
.to_html
160 fun test_cmd_ini_maintainer
is test
do
161 var cmd
= new CmdIniMaintainer(test_model
, mentity_name
= "test_prog")
163 print_html cmd
.to_html
166 fun test_cmd_ini_contributors
is test
do
167 var cmd
= new CmdIniContributors(test_model
, mentity_name
= "test_prog")
169 print_html cmd
.to_html
172 fun test_cmd_ini_license
is test
do
173 var cmd
= new CmdIniLicense(test_model
, mentity_name
= "test_prog")
175 print_html cmd
.to_html
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
182 print_html cmd
.to_html
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
189 print_html cmd
.to_html
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
196 print_html cmd
.to_html
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
203 print_html cmd
.to_html
208 fun test_cmd_mains
is test
do
209 var cmd
= new CmdMains(test_model
, mentity_name
= "test_prog")
211 print_html cmd
.to_html
214 fun test_cmd_main_compile
is test
do
215 var cmd
= new CmdMainCompile(test_model
, mentity_name
= "test_prog::test_prog")
217 print_html cmd
.to_html
220 fun test_cmd_testing
is test
do
221 var cmd
= new CmdTesting(test_model
, mentity_name
= "test_prog")
223 print_html cmd
.to_html
226 fun test_cmd_man_synopsis
is test
do
227 var cmd
= new CmdManSynopsis(test_model
, mentity_name
= "test_prog")
229 print_html cmd
.to_html
232 fun test_cmd_man_options
is test
do
233 var cmd
= new CmdManOptions(test_model
, mentity_name
= "test_prog")
235 print_html cmd
.to_html
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