doc/commands: add tests for commands_html
authorAlexandre Terrasa <alexandre@moz-code.org>
Wed, 2 May 2018 22:39:54 +0000 (18:39 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Wed, 2 May 2018 22:39:54 +0000 (18:39 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

15 files changed:
src/doc/commands/tests/test_commands_html.nit [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_ancestors.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_call.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_children.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_comment.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_descendants.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_entity.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_features.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_lin.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_mentities.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_new.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_param.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_parents.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_return.res [new file with mode: 0644]
src/doc/commands/tests/test_commands_html.sav/test_cmd_search.res [new file with mode: 0644]

diff --git a/src/doc/commands/tests/test_commands_html.nit b/src/doc/commands/tests/test_commands_html.nit
new file mode 100644 (file)
index 0000000..f88e425
--- /dev/null
@@ -0,0 +1,126 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+module test_commands_html is test
+
+import test_commands
+import doc::commands::commands_html
+
+class TestCommandsHtml
+       super TestCommands
+       test
+
+       fun print_html(html: nullable Writable) do
+               if html == null then return
+               print html
+       end
+
+       # CmdEntity
+
+       fun test_cmd_entity is test do
+               var cmd = new CmdEntity(test_view, mentity_name = "test_prog::Character")
+               cmd.init_command
+               print_html cmd.to_html
+       end
+
+       fun test_cmd_comment is test do
+               var cmd = new CmdComment(test_view, mentity_name = "test_prog::Character")
+               cmd.init_command
+               print_html cmd.to_html
+       end
+
+       # CmdInheritance
+
+       fun test_cmd_parents is test do
+               var cmd = new CmdParents(test_view, mentity_name = "test_prog::Warrior")
+               cmd.init_command
+               print_html cmd.to_html
+       end
+
+       fun test_cmd_ancestors is test do
+               var cmd = new CmdAncestors(test_view, mentity_name = "test_prog::Warrior", parents = false)
+               cmd.init_command
+               print_html cmd.to_html
+       end
+
+       fun test_cmd_children is test do
+               var cmd = new CmdChildren(test_view, mentity_name = "test_prog::Career")
+               cmd.init_command
+               print_html cmd.to_html
+       end
+
+       fun test_cmd_descendants is test do
+               var cmd = new CmdDescendants(test_view, mentity_name = "test_prog::Career")
+               cmd.init_command
+               print_html cmd.to_html
+       end
+
+       # CmdSearch
+
+       fun test_cmd_search is test do
+               var cmd = new CmdSearch(test_view, query = "Carer", limit = 10)
+               cmd.init_command
+               print_html cmd.to_html
+       end
+
+       # CmdFeatures
+
+       fun test_cmd_features is test do
+               var cmd = new CmdFeatures(test_view, mentity_name = "test_prog::Career")
+               cmd.init_command
+               print_html cmd.to_html
+       end
+
+       # CmdLinearization
+
+       fun test_cmd_lin is test do
+               var cmd = new CmdLinearization(test_view, mentity_name = "init")
+               cmd.init_command
+               print_html cmd.to_html
+       end
+
+       # CmdModel
+
+       fun test_cmd_mentities is test do
+               var cmd = new CmdModelEntities(test_view, kind = "modules")
+               cmd.init_command
+               print_html cmd.to_html
+       end
+
+       # CmdUsage
+
+       fun test_cmd_new is test do
+               var cmd = new CmdNew(test_view, test_builder, mentity_name = "test_prog::Character")
+               cmd.init_command
+               print_html cmd.to_html
+       end
+
+       fun test_cmd_call is test do
+               var cmd = new CmdCall(test_view, test_builder, mentity_name = "strength_bonus")
+               cmd.init_command
+               print_html cmd.to_html
+       end
+
+       fun test_cmd_return is test do
+               var cmd = new CmdReturn(test_view, mentity_name = "test_prog::Character")
+               cmd.init_command
+               print_html cmd.to_html
+       end
+
+       fun test_cmd_param is test do
+               var cmd = new CmdParam(test_view, mentity_name = "test_prog::Character")
+               cmd.init_command
+               print_html cmd.to_html
+       end
+end
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_ancestors.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_ancestors.res
new file mode 100644 (file)
index 0000000..494edd2
--- /dev/null
@@ -0,0 +1 @@
+<ul><li><a href="class_test_prog_58d_58dObject.html" title="Root of everything.">Object</a> - <span class="synopsys nitdoc">Root of everything.</span></li></ul>
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_call.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_call.res
new file mode 100644 (file)
index 0000000..bd7e9de
--- /dev/null
@@ -0,0 +1 @@
+<ul><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dCharacter_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dCharacter_58d_58dtotal_strengh.html#test_prog_36dCharacter_36dtotal_strengh" title="The actual strength of the character.">total_strengh</a> - <span class="synopsys nitdoc">The actual strength of the character.</span></li></ul>
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_children.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_children.res
new file mode 100644 (file)
index 0000000..90bfe86
--- /dev/null
@@ -0,0 +1 @@
+<ul><li><a href="class_test_prog_58d_58dAlcoholic.html" title="Alcoholics are good to nothing escept taking punches.">Alcoholic</a> - <span class="synopsys nitdoc">Alcoholics are good to nothing escept taking punches.</span></li><li><a href="class_test_prog_58d_58dMagician.html" title="Magicians know magic and how to use it.">Magician</a> - <span class="synopsys nitdoc">Magicians know magic and how to use it.</span></li><li><a href="class_test_prog_58d_58dWarrior.html" title="Warriors are good for fighting.">Warrior</a> - <span class="synopsys nitdoc">Warriors are good for fighting.</span></li></ul>
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_comment.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_comment.res
new file mode 100644 (file)
index 0000000..af04617
--- /dev/null
@@ -0,0 +1 @@
+<h3><a href="class_test_prog_58d_58dCharacter.html" title="Characters can be played by both the human or the machine.">Character</a> - <span class="synopsys nitdoc">Characters can be played by both the human or the machine.</span></h3><div class="nitdoc"></div>
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_descendants.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_descendants.res
new file mode 100644 (file)
index 0000000..90bfe86
--- /dev/null
@@ -0,0 +1 @@
+<ul><li><a href="class_test_prog_58d_58dAlcoholic.html" title="Alcoholics are good to nothing escept taking punches.">Alcoholic</a> - <span class="synopsys nitdoc">Alcoholics are good to nothing escept taking punches.</span></li><li><a href="class_test_prog_58d_58dMagician.html" title="Magicians know magic and how to use it.">Magician</a> - <span class="synopsys nitdoc">Magicians know magic and how to use it.</span></li><li><a href="class_test_prog_58d_58dWarrior.html" title="Warriors are good for fighting.">Warrior</a> - <span class="synopsys nitdoc">Warriors are good for fighting.</span></li></ul>
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_entity.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_entity.res
new file mode 100644 (file)
index 0000000..5084eba
--- /dev/null
@@ -0,0 +1 @@
+<a href="class_test_prog_58d_58dCharacter.html" title="Characters can be played by both the human or the machine.">Character</a>
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_features.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_features.res
new file mode 100644 (file)
index 0000000..23f7a6f
--- /dev/null
@@ -0,0 +1 @@
+<ul><li><a href="property_test_prog_58d_58dcareers_58d_58dCareer_58d_58d_endurance_bonus.html">_endurance_bonus</a></li><li><a href="property_test_prog_58d_58dcareers_58d_58dCareer_58d_58d_intelligence_bonus.html">_intelligence_bonus</a></li><li><a href="property_test_prog_58d_58dcareers_58d_58dCareer_58d_58d_strength_bonus.html">_strength_bonus</a></li><li><a href="property_test_prog_58d_58dCareer_58d_58dendurance_bonus.html">endurance_bonus</a></li><li><a href="property_test_prog_58d_58dCareer_58d_58dendurance_bonus_61d.html">endurance_bonus=</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dCareer_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dCareer_58d_58dintelligence_bonus.html">intelligence_bonus</a></li><li><a href="property_test_prog_58d_58dCareer_58d_58dintelligence_bonus_61d.html">intelligence_bonus=</a></li><li><a href="property_test_prog_58d_58dCareer_58d_58dstrength_bonus.html">strength_bonus</a></li><li><a href="property_test_prog_58d_58dCareer_58d_58dstrength_bonus_61d.html">strength_bonus=</a></li></ul>
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_lin.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_lin.res
new file mode 100644 (file)
index 0000000..cb19b6f
--- /dev/null
@@ -0,0 +1 @@
+<ul><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dObject_36dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dRace_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dCareer_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dHuman_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dElf_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dWarrior_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dMagician_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dAlcoholic_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dCharacter_36dObject_58d_58dinit">init</a></li><li><a href="property_test_prog_58d_58dObject_58d_58dinit.html#test_prog_36dDwarf_36dObject_58d_58dinit">init</a></li></ul>
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_mentities.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_mentities.res
new file mode 100644 (file)
index 0000000..f056d4c
--- /dev/null
@@ -0,0 +1 @@
+<ul><li><a href="module_test_prog_58d_58dcareers.html" title="Careers of the game.">careers</a> - <span class="synopsys nitdoc">Careers of the game.</span></li><li><a href="module_test_prog_58d_58dcharacter.html" title="Characters are playable entity in the world.">character</a> - <span class="synopsys nitdoc">Characters are playable entity in the world.</span></li><li><a href="module_test_prog_58d_58dcombat.html" title="COmbat interactions between characters.">combat</a> - <span class="synopsys nitdoc">COmbat interactions between characters.</span></li><li><a href="module_excluded_58d_58dexcluded.html">excluded</a></li><li><a href="module_test_prog_58d_58dgame.html" title="A game abstraction for RPG.">game</a> - <span class="synopsys nitdoc">A game abstraction for RPG.</span></li><li><a href="module_test_prog_58d_58dgame_examples.html">game_examples</a></li><li><a href="module_test_prog_58d_58dplatform.html" title="Declares base types allowed on the platform.">platform</a> - <span class="synopsys nitdoc">Declares base types allowed on the platform.</span></li><li><a href="module_test_prog_58d_58draces.html" title="Races of the game.">races</a> - <span class="synopsys nitdoc">Races of the game.</span></li><li><a href="module_test_prog_58d_58drpg.html" title="A worlg RPG abstraction.">rpg</a> - <span class="synopsys nitdoc">A worlg RPG abstraction.</span></li><li><a href="module_test_prog_58d_58dtest_prog.html" title="A test program with a fake model to check model tools.">test_prog</a> - <span class="synopsys nitdoc">A test program with a fake model to check model tools.</span></li></ul>
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_new.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_new.res
new file mode 100644 (file)
index 0000000..b40db03
--- /dev/null
@@ -0,0 +1 @@
+<ul></ul>
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_param.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_param.res
new file mode 100644 (file)
index 0000000..b40db03
--- /dev/null
@@ -0,0 +1 @@
+<ul></ul>
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_parents.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_parents.res
new file mode 100644 (file)
index 0000000..763ba62
--- /dev/null
@@ -0,0 +1 @@
+<ul><li><a href="class_test_prog_58d_58dCareer.html" title="A `Career` gives a characteristic bonus or malus to the character.">Career</a> - <span class="synopsys nitdoc">A <code class="nitcode"><span class="nitcode"><span class="line"><span class="nc_t">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span></li></ul>
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_return.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_return.res
new file mode 100644 (file)
index 0000000..b40db03
--- /dev/null
@@ -0,0 +1 @@
+<ul></ul>
diff --git a/src/doc/commands/tests/test_commands_html.sav/test_cmd_search.res b/src/doc/commands/tests/test_commands_html.sav/test_cmd_search.res
new file mode 100644 (file)
index 0000000..1a15d91
--- /dev/null
@@ -0,0 +1 @@
+<ul><li><a href="class_test_prog_58d_58dCareer.html" title="A `Career` gives a characteristic bonus or malus to the character.">Career</a> - <span class="synopsys nitdoc">A <code class="nitcode"><span class="nitcode"><span class="line"><span class="nc_t">Career</span></span></span></code> gives a characteristic bonus or malus to the character.</span></li><li><a href="property_test_prog_58d_58dCharacter_58d_58dcareer.html" title="The current `Career` of the character.">career</a> - <span class="synopsys nitdoc">The current <code class="nitcode"><span class="nitcode"><span class="line"><span class="nc_t">Career</span></span></span></code> of the character.</span></li><li><a href="group_test_prog_62dgame_62d.html" title="Gaming group">game</a> - <span class="synopsys nitdoc">Gaming group</span></li><li><a href="module_test_prog_58d_58dgame.html" title="A game abstraction for RPG.">game</a> - <span class="synopsys nitdoc">A game abstraction for RPG.</span></li><li><a href="module_test_prog_58d_58draces.html" title="Races of the game.">races</a> - <span class="synopsys nitdoc">Races of the game.</span></li><li><a href="module_test_prog_58d_58dcareers.html" title="Careers of the game.">careers</a> - <span class="synopsys nitdoc">Careers of the game.</span></li><li><a href="class_test_prog_58d_58dGame.html" title="This is the interface you have to implement to use ure gaming platform.">Game</a> - <span class="synopsys nitdoc">This is the interface you have to implement to use ure gaming platform.</span></li><li><a href="class_test_prog_58d_58dRace.html" title="Race determines basic characteristics and what the character will be able to do in life.">Race</a> - <span class="synopsys nitdoc">Race determines basic characteristics and what the character will be able to do in life.</span></li><li><a href="class_test_prog_58d_58dStarter.html">Starter</a></li><li><a href="property_test_prog_58d_58dCharacter_58d_58dage.html">age</a></li></ul>