X-Git-Url: http://nitlanguage.org diff --git a/src/doc/commands/tests/test_commands_model.nit b/src/doc/commands/tests/test_commands_model.nit index 88d5e5e..41bcfe7 100644 --- a/src/doc/commands/tests/test_commands_model.nit +++ b/src/doc/commands/tests/test_commands_model.nit @@ -24,28 +24,28 @@ class TestCommandsModel # CmdEntity fun test_cmd_entity is test do - var cmd = new CmdEntity(test_view, mentity_name = "test_prog::Character") + var cmd = new CmdEntity(test_model, test_filter, mentity_name = "test_prog::Character") var res = cmd.init_command assert res isa CmdSuccess assert cmd.mentity.as(not null).full_name == "test_prog::Character" end fun test_cmd_entity_not_found is test do - var cmd = new CmdEntity(test_view, mentity_name = "test_prog::Characterzz") + var cmd = new CmdEntity(test_model, test_filter, mentity_name = "test_prog::Characterzz") var res = cmd.init_command assert res isa ErrorMEntityNotFound assert res.suggestions.first.full_name == "test_prog::Character" end fun test_cmd_entity_conflict is test do - var cmd = new CmdEntity(test_view, mentity_name = "+") + var cmd = new CmdEntity(test_model, test_filter, mentity_name = "+") var res = cmd.init_command assert res isa ErrorMEntityConflict assert res.conflicts.length == 2 end fun test_cmd_entity_no_name is test do - var cmd = new CmdEntity(test_view) + var cmd = new CmdEntity(test_model, test_filter) var res = cmd.init_command assert res isa ErrorMEntityNoName end @@ -53,14 +53,14 @@ class TestCommandsModel # CmdComment fun test_cmd_comment is test do - var cmd = new CmdComment(test_view, mentity_name = "test_prog::Character") + var cmd = new CmdComment(test_model, test_filter, mentity_name = "test_prog::Character") var res = cmd.init_command assert res isa CmdSuccess assert cmd.mdoc != null end fun test_cmd_comment_no_mdoc is test do - var cmd = new CmdComment(test_view, mentity_name = "test_prog::Character", fallback = false) + var cmd = new CmdComment(test_model, test_filter, mentity_name = "test_prog::Character", fallback = false) var res = cmd.init_command assert res isa WarningNoMDoc end @@ -68,7 +68,7 @@ class TestCommandsModel # CmdLink fun test_cmd_link is test do - var cmd = new CmdEntityLink(test_view, mentity_name = "test_prog::Character") + var cmd = new CmdEntityLink(test_model, test_filter, mentity_name = "test_prog::Character") var res = cmd.init_command assert res isa CmdSuccess assert cmd.text == "Character" @@ -76,7 +76,7 @@ class TestCommandsModel end fun test_cmd_link_with_text is test do - var cmd = new CmdEntityLink(test_view, mentity_name = "test_prog::Character", text = "foo") + var cmd = new CmdEntityLink(test_model, test_filter, mentity_name = "test_prog::Character", text = "foo") var res = cmd.init_command assert res isa CmdSuccess assert cmd.text == "foo" @@ -84,7 +84,7 @@ class TestCommandsModel end fun test_cmd_link_with_title is test do - var cmd = new CmdEntityLink(test_view, mentity_name = "test_prog::Character", title = "bar") + var cmd = new CmdEntityLink(test_model, test_filter, mentity_name = "test_prog::Character", title = "bar") var res = cmd.init_command assert res isa CmdSuccess assert cmd.text == "Character" @@ -92,7 +92,7 @@ class TestCommandsModel end fun test_cmd_link_with_text_and_title is test do - var cmd = new CmdEntityLink(test_view, mentity_name = "test_prog::Character", + var cmd = new CmdEntityLink(test_model, test_filter, mentity_name = "test_prog::Character", text = "foo", title = "bar") var res = cmd.init_command assert res isa CmdSuccess @@ -103,35 +103,35 @@ class TestCommandsModel # CmdInheritance fun test_cmd_parents is test do - var cmd = new CmdParents(test_view, mentity_name = "test_prog::Warrior") + var cmd = new CmdParents(test_model, test_main, test_filter, mentity_name = "test_prog::Warrior") var res = cmd.init_command assert res isa CmdSuccess assert cmd.results.as(not null).length == 1 end fun test_cmd_ancestors is test do - var cmd = new CmdAncestors(test_view, mentity_name = "test_prog::Warrior") + var cmd = new CmdAncestors(test_model, test_main, test_filter, mentity_name = "test_prog::Warrior") var res = cmd.init_command assert res isa CmdSuccess assert cmd.results.as(not null).length == 2 end - fun test_cmd_ancestorsi_without_parents is test do - var cmd = new CmdAncestors(test_view, mentity_name = "test_prog::Warrior", parents = false) + fun test_cmd_ancestors_without_parents is test do + var cmd = new CmdAncestors(test_model, test_main, test_filter, mentity_name = "test_prog::Warrior", parents = false) var res = cmd.init_command assert res isa CmdSuccess assert cmd.results.as(not null).length == 1 end fun test_cmd_children is test do - var cmd = new CmdChildren(test_view, mentity_name = "test_prog::Career") + var cmd = new CmdChildren(test_model, test_main, test_filter, mentity_name = "test_prog::Career") var res = cmd.init_command assert res isa CmdSuccess assert cmd.results.as(not null).length == 3 end fun test_cmd_descendants is test do - var cmd = new CmdDescendants(test_view, mentity_name = "test_prog::Career", children = false) + var cmd = new CmdDescendants(test_model, test_main, test_filter, mentity_name = "test_prog::Career", children = false) var res = cmd.init_command assert res isa CmdSuccess assert cmd.results.as(not null).length == 0 @@ -140,14 +140,14 @@ class TestCommandsModel # CmdSearch fun test_cmd_search is test do - var cmd = new CmdSearch(test_view, query = "Carer") + var cmd = new CmdSearch(test_model, test_filter, query = "Carer") var res = cmd.init_command assert res isa CmdSuccess assert cmd.results.as(not null).first.full_name == "test_prog::Career" end fun test_cmd_search_no_query is test do - var cmd = new CmdSearch(test_view) + var cmd = new CmdSearch(test_model, test_filter) var res = cmd.init_command assert res isa ErrorNoQuery end @@ -155,14 +155,14 @@ class TestCommandsModel # CmdFeatures fun test_cmd_features is test do - var cmd = new CmdFeatures(test_view, mentity_name = "test_prog::Career") + var cmd = new CmdFeatures(test_model, test_filter, mentity_name = "test_prog::Career") var res = cmd.init_command assert res isa CmdSuccess assert cmd.results.as(not null).length == 10 end fun test_cmd_features_no_features is test do - var cmd = new CmdFeatures(test_view, mentity_name = "test_prog$Career$strength_bonus") + var cmd = new CmdFeatures(test_model, test_filter, mentity_name = "test_prog$Career$strength_bonus") var res = cmd.init_command assert res isa WarningNoFeatures end @@ -170,15 +170,14 @@ class TestCommandsModel # CmdLinearization fun test_cmd_lin is test do - var cmd = new CmdLinearization(test_view, mentity_name = "init") + var cmd = new CmdLinearization(test_model, test_main, test_filter, mentity_name = "init") var res = cmd.init_command assert res isa CmdSuccess - print cmd.results.as(not null) assert cmd.results.as(not null).length == 10 end fun test_cmd_lin_no_lin is test do - var cmd = new CmdLinearization(test_view, mentity_name = "test_prog") + var cmd = new CmdLinearization(test_model, test_main, test_filter, mentity_name = "test_prog") var res = cmd.init_command assert res isa WarningNoLinearization end @@ -186,14 +185,14 @@ class TestCommandsModel # CmdCode fun test_cmd_code is test do - var cmd = new CmdEntityCode(test_view, test_builder, mentity_name = "test_prog::Career") + var cmd = new CmdEntityCode(test_model, test_builder, test_filter, mentity_name = "test_prog::Career") var res = cmd.init_command assert res isa CmdSuccess assert cmd.node isa AStdClassdef end fun test_cmd_code_no_code is test do - var cmd = new CmdEntityCode(test_view, test_builder, mentity_name = "test_prog") + var cmd = new CmdEntityCode(test_model, test_builder, test_filter, mentity_name = "test_prog") var res = cmd.init_command assert res isa WarningNoCode end @@ -201,14 +200,14 @@ class TestCommandsModel # CmdModel fun test_cmd_results is test do - var cmd = new CmdModelEntities(test_view, kind = "modules") + var cmd = new CmdModelEntities(test_model, test_filter, kind = "modules") var res = cmd.init_command assert res isa CmdSuccess - assert cmd.results.as(not null).length == 11 + assert cmd.results.as(not null).length == 10 end fun test_cmd_results_random is test do - var cmd = new CmdRandomEntities(test_view, kind = "packages") + var cmd = new CmdRandomEntities(test_model, test_filter, kind = "packages") var res = cmd.init_command assert res isa CmdSuccess assert cmd.results.as(not null).length == 2