From 6ea42d02f0c53218b9a17c4dbffa125655e9559e Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Wed, 2 May 2018 18:39:54 -0400 Subject: [PATCH] doc/commands: add tests for commands_html Signed-off-by: Alexandre Terrasa --- src/doc/commands/tests/test_commands_html.nit | 126 ++++++++++++++++++++ .../test_commands_html.sav/test_cmd_ancestors.res | 1 + .../tests/test_commands_html.sav/test_cmd_call.res | 1 + .../test_commands_html.sav/test_cmd_children.res | 1 + .../test_commands_html.sav/test_cmd_comment.res | 1 + .../test_cmd_descendants.res | 1 + .../test_commands_html.sav/test_cmd_entity.res | 1 + .../test_commands_html.sav/test_cmd_features.res | 1 + .../tests/test_commands_html.sav/test_cmd_lin.res | 1 + .../test_commands_html.sav/test_cmd_mentities.res | 1 + .../tests/test_commands_html.sav/test_cmd_new.res | 1 + .../test_commands_html.sav/test_cmd_param.res | 1 + .../test_commands_html.sav/test_cmd_parents.res | 1 + .../test_commands_html.sav/test_cmd_return.res | 1 + .../test_commands_html.sav/test_cmd_search.res | 1 + 15 files changed, 140 insertions(+) create mode 100644 src/doc/commands/tests/test_commands_html.nit create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_ancestors.res create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_call.res create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_children.res create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_comment.res create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_descendants.res create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_entity.res create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_features.res create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_lin.res create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_mentities.res create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_new.res create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_param.res create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_parents.res create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_return.res create mode 100644 src/doc/commands/tests/test_commands_html.sav/test_cmd_search.res diff --git a/src/doc/commands/tests/test_commands_html.nit b/src/doc/commands/tests/test_commands_html.nit new file mode 100644 index 0000000..f88e425 --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.nit @@ -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 index 0000000..494edd2 --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_ancestors.res @@ -0,0 +1 @@ + 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 index 0000000..bd7e9de --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_call.res @@ -0,0 +1 @@ + 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 index 0000000..90bfe86 --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_children.res @@ -0,0 +1 @@ + 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 index 0000000..af04617 --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_comment.res @@ -0,0 +1 @@ +

Character - Characters can be played by both the human or the machine.

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 index 0000000..90bfe86 --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_descendants.res @@ -0,0 +1 @@ + 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 index 0000000..5084eba --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_entity.res @@ -0,0 +1 @@ +Character 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 index 0000000..23f7a6f --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_features.res @@ -0,0 +1 @@ + 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 index 0000000..cb19b6f --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_lin.res @@ -0,0 +1 @@ + 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 index 0000000..f056d4c --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_mentities.res @@ -0,0 +1 @@ + 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 index 0000000..b40db03 --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_new.res @@ -0,0 +1 @@ + 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 index 0000000..b40db03 --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_param.res @@ -0,0 +1 @@ + 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 index 0000000..763ba62 --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_parents.res @@ -0,0 +1 @@ + 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 index 0000000..b40db03 --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_return.res @@ -0,0 +1 @@ + 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 index 0000000..1a15d91 --- /dev/null +++ b/src/doc/commands/tests/test_commands_html.sav/test_cmd_search.res @@ -0,0 +1 @@ + -- 1.7.9.5