From 9872c014ca2da64dbc692cf1903372cef6bd59d9 Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Thu, 14 Jun 2018 16:20:12 -0400 Subject: [PATCH] src/model/model_index: fix tests Signed-off-by: Alexandre Terrasa --- src/doc/commands/tests/test_commands_catalog.nit | 2 +- src/doc/commands/tests/test_commands_http.nit | 2 +- src/doc/commands/tests/test_commands_model.nit | 2 +- src/doc/commands/tests/test_commands_parser.nit | 2 +- .../test_html_commands.sav/test_cmd_search.res | 2 +- .../test_json_commands.sav/test_cmd_search.res | 157 +------------------- .../tests/test_md_commands.sav/test_cmd_search.res | 9 -- .../tests/test_term.sav/test_mentity_not_found.res | 10 -- src/doc/term/tests/test_term.sav/test_search.res | 5 - .../test_term.sav/test_term_catalog_search.res | 10 -- tests/sav/test_model_index_args10.res | 13 +- tests/sav/test_model_index_args11.res | 13 +- tests/sav/test_model_index_args12.res | 13 +- tests/sav/test_model_index_args13.res | 9 -- tests/sav/test_model_index_args14.res | 6 +- tests/sav/test_model_index_args15.res | 10 +- tests/sav/test_model_index_args16.res | 13 +- tests/sav/test_model_index_args17.res | 14 +- tests/sav/test_model_index_args18.res | 6 +- tests/sav/test_model_index_args19.res | 10 +- tests/sav/test_model_index_args20.res | 13 +- tests/sav/test_model_index_args21.res | 14 +- tests/sav/test_model_index_args8.res | 2 +- tests/sav/test_model_index_args9.res | 13 +- tests/test_model_index.args | 12 +- 25 files changed, 50 insertions(+), 312 deletions(-) diff --git a/src/doc/commands/tests/test_commands_catalog.nit b/src/doc/commands/tests/test_commands_catalog.nit index ecb038c..5e921b5 100644 --- a/src/doc/commands/tests/test_commands_catalog.nit +++ b/src/doc/commands/tests/test_commands_catalog.nit @@ -74,7 +74,7 @@ class TestCommandsCatalog fun test_cmd_catalog_search_with_filter is test do var filter = new ModelFilter(accept_example = false) - var cmd = new CmdCatalogSearch(test_model, test_catalog, filter, query = "MyGame") + var cmd = new CmdCatalogSearch(test_model, test_catalog, filter, query = "MGame") var res = cmd.init_command assert res isa CmdSuccess assert cmd.results.as(not null).first.full_name == "test_prog::Game" # not MyGame diff --git a/src/doc/commands/tests/test_commands_http.nit b/src/doc/commands/tests/test_commands_http.nit index a08854c..57f5dd6 100644 --- a/src/doc/commands/tests/test_commands_http.nit +++ b/src/doc/commands/tests/test_commands_http.nit @@ -45,7 +45,7 @@ class TestCommandsHttp end fun test_cmd_http_entity_not_found is test do - var req = new_request("/Characterzzz") + var req = new_request("/Characterz") var cmd = new CmdEntity(test_model) var res = cmd.http_init(req) assert res isa ErrorMEntityNotFound diff --git a/src/doc/commands/tests/test_commands_model.nit b/src/doc/commands/tests/test_commands_model.nit index 4909823..4847987 100644 --- a/src/doc/commands/tests/test_commands_model.nit +++ b/src/doc/commands/tests/test_commands_model.nit @@ -31,7 +31,7 @@ class TestCommandsModel end fun test_cmd_entity_not_found is test do - var cmd = new CmdEntity(test_model, mentity_name = "test_prog::Characterzz") + var cmd = new CmdEntity(test_model, mentity_name = "test_prog::Characterz") var res = cmd.init_command assert res isa ErrorMEntityNotFound assert res.suggestions.first.full_name == "test_prog::Character" diff --git a/src/doc/commands/tests/test_commands_parser.nit b/src/doc/commands/tests/test_commands_parser.nit index ea54a8b..41cc36b 100644 --- a/src/doc/commands/tests/test_commands_parser.nit +++ b/src/doc/commands/tests/test_commands_parser.nit @@ -210,7 +210,7 @@ class TestCommandsParser fun test_cmd_parser_search_limit is test do var parser = new CommandParser(test_model, test_main, test_builder, test_catalog) - var cmd = parser.parse("search: Caracter | limit: 2") + var cmd = parser.parse("search: strength | limit: 2") assert cmd isa CmdSearch assert parser.error == null assert cmd.results.as(not null).length == 2 diff --git a/src/doc/templates/tests/test_html_commands.sav/test_cmd_search.res b/src/doc/templates/tests/test_html_commands.sav/test_cmd_search.res index a6b9ace..2953e58 100644 --- a/src/doc/templates/tests/test_html_commands.sav/test_cmd_search.res +++ b/src/doc/templates/tests/test_html_commands.sav/test_cmd_search.res @@ -1 +1 @@ - + diff --git a/src/doc/templates/tests/test_json_commands.sav/test_cmd_search.res b/src/doc/templates/tests/test_json_commands.sav/test_cmd_search.res index d58aef9..93e7114 100644 --- a/src/doc/templates/tests/test_json_commands.sav/test_cmd_search.res +++ b/src/doc/templates/tests/test_json_commands.sav/test_cmd_search.res @@ -14,162 +14,9 @@ "visibility": "public", "html_synopsis": "A Career gives a characteristic bonus or malus to the character.", "modifiers": ["abstract class"] - }, { - "name": "career", - "synopsis": "The current `Career` of the character.", - "namespace": [{ - "name": "test_prog", - "synopsis": "Test program for model tools." - }, "::", { - "name": "Character", - "synopsis": "Characters can be played by both the human or the machine." - }, "::", { - "name": "career", - "synopsis": "The current `Career` of the character." - }], - "class_name": "MMethod", - "full_name": "test_prog::Character::career", - "visibility": "public", - "html_synopsis": "The current Career of the character.", - "modifiers": ["fun"], - "msignature": { - "arity": 0, - "mparameters": [], - "return_mtype": { - "name": "nullable Career", - "synopsis": "A `Career` gives a characteristic bonus or malus to the character.", - "html_synopsis": "A Career gives a characteristic bonus or malus to the character." - } - } - }, { - "name": "game", - "synopsis": "Gaming group", - "namespace": [{ - "name": "test_prog", - "synopsis": "Test program for model tools." - }, ">", { - "name": "game", - "synopsis": "Gaming group" - }, ">"], - "class_name": "MGroup", - "full_name": "test_prog>game>", - "visibility": "public", - "html_synopsis": "Gaming group", - "modifiers": ["group"] - }, { - "name": "game", - "synopsis": "A game abstraction for RPG.", - "namespace": [{ - "name": "test_prog", - "synopsis": "Test program for model tools." - }, "::", { - "name": "game", - "synopsis": "A game abstraction for RPG." - }], - "class_name": "MModule", - "full_name": "test_prog::game", - "visibility": "public", - "html_synopsis": "A game abstraction for RPG.", - "modifiers": ["module"] - }, { - "name": "races", - "synopsis": "Races of the game.", - "namespace": [{ - "name": "test_prog", - "synopsis": "Test program for model tools." - }, "::", { - "name": "races", - "synopsis": "Races of the game." - }], - "class_name": "MModule", - "full_name": "test_prog::races", - "visibility": "public", - "html_synopsis": "Races of the game.", - "modifiers": ["module"] - }, { - "name": "careers", - "synopsis": "Careers of the game.", - "namespace": [{ - "name": "test_prog", - "synopsis": "Test program for model tools." - }, "::", { - "name": "careers", - "synopsis": "Careers of the game." - }], - "class_name": "MModule", - "full_name": "test_prog::careers", - "visibility": "public", - "html_synopsis": "Careers of the game.", - "modifiers": ["module"] - }, { - "name": "Game", - "synopsis": "This is the interface you have to implement to use ure gaming platform.", - "namespace": [{ - "name": "test_prog", - "synopsis": "Test program for model tools." - }, "::", { - "name": "Game", - "synopsis": "This is the interface you have to implement to use ure gaming platform." - }], - "class_name": "MClass", - "full_name": "test_prog::Game", - "visibility": "public", - "html_synopsis": "This is the interface you have to implement to use ure gaming platform.", - "modifiers": ["interface"] - }, { - "name": "Race", - "synopsis": "Race determines basic characteristics and what the character will be able to do in life.", - "namespace": [{ - "name": "test_prog", - "synopsis": "Test program for model tools." - }, "::", { - "name": "Race", - "synopsis": "Race determines basic characteristics and what the character will be able to do in life." - }], - "class_name": "MClass", - "full_name": "test_prog::Race", - "visibility": "public", - "html_synopsis": "Race determines basic characteristics and what the character will be able to do in life.", - "modifiers": ["abstract class"] - }, { - "name": "Starter", - "namespace": [{ - "name": "test_prog", - "synopsis": "Test program for model tools." - }, "::", { - "name": "Starter" - }], - "class_name": "MClass", - "full_name": "test_prog::Starter", - "visibility": "public", - "modifiers": ["class"] - }, { - "name": "age", - "namespace": [{ - "name": "test_prog", - "synopsis": "Test program for model tools." - }, "::", { - "name": "Character", - "synopsis": "Characters can be played by both the human or the machine." - }, "::", { - "name": "age" - }], - "class_name": "MMethod", - "full_name": "test_prog::Character::age", - "visibility": "public", - "modifiers": ["fun"], - "msignature": { - "arity": 0, - "mparameters": [], - "return_mtype": { - "name": "Int", - "synopsis": "Some services about Integers.", - "html_synopsis": "Some services about Integers." - } - } }], "page": 1, - "count": 121, + "count": 1, "limit": 10, - "max": 12 + "max": 1 } diff --git a/src/doc/templates/tests/test_md_commands.sav/test_cmd_search.res b/src/doc/templates/tests/test_md_commands.sav/test_cmd_search.res index 577166b..695c2ff 100644 --- a/src/doc/templates/tests/test_md_commands.sav/test_cmd_search.res +++ b/src/doc/templates/tests/test_md_commands.sav/test_cmd_search.res @@ -1,10 +1 @@ * `Career` - A `Career` gives a characteristic bonus or malus to the character. -* `career` - The current `Career` of the character. -* `game` - Gaming group -* `game` - A game abstraction for RPG. -* `races` - Races of the game. -* `careers` - Careers of the game. -* `Game` - This is the interface you have to implement to use ure gaming platform. -* `Race` - Race determines basic characteristics and what the character will be able to do in life. -* `Starter` -* `age` diff --git a/src/doc/term/tests/test_term.sav/test_mentity_not_found.res b/src/doc/term/tests/test_term.sav/test_mentity_not_found.res index ff87303..c7eba98 100644 --- a/src/doc/term/tests/test_term.sav/test_mentity_not_found.res +++ b/src/doc/term/tests/test_term.sav/test_mentity_not_found.res @@ -7,14 +7,4 @@ Did you mean? class Character test_location - + test_prog::character - # Characters are playable entity in the world. - module character - test_location - - + test_prog::Career - # A `Career` gives a characteristic bonus or malus to the character. - abstract class Career - test_location - diff --git a/src/doc/term/tests/test_term.sav/test_search.res b/src/doc/term/tests/test_term.sav/test_search.res index 965f6dc..35998c4 100644 --- a/src/doc/term/tests/test_term.sav/test_search.res +++ b/src/doc/term/tests/test_term.sav/test_search.res @@ -5,8 +5,3 @@ Search results for `Caracter`: class Character test_location - + test_prog::character - # Characters are playable entity in the world. - module character - test_location - diff --git a/src/doc/term/tests/test_term.sav/test_term_catalog_search.res b/src/doc/term/tests/test_term.sav/test_term_catalog_search.res index ae5fe51..35998c4 100644 --- a/src/doc/term/tests/test_term.sav/test_term_catalog_search.res +++ b/src/doc/term/tests/test_term.sav/test_term_catalog_search.res @@ -5,13 +5,3 @@ Search results for `Caracter`: class Character test_location - + test_prog::character - # Characters are playable entity in the world. - module character - test_location - - + test_prog::Career - # A `Career` gives a characteristic bonus or malus to the character. - abstract class Career - test_location - diff --git a/tests/sav/test_model_index_args10.res b/tests/sav/test_model_index_args10.res index d68740c..a6058fd 100644 --- a/tests/sav/test_model_index_args10.res +++ b/tests/sav/test_model_index_args10.res @@ -1,12 +1,3 @@ -# elfves +# elf - * 4: Elf (test_prog::Elf) - * 5: Sys (test_prog::Sys) - * 5: careers (test_prog::careers) - * 5: examples (test_prog>examples>) - * 5: excluded (excluded>) - * 5: excluded (excluded) - * 5: excluded (excluded::excluded) - * 5: game (test_prog>game>) - * 5: game (test_prog::game) - * 4: races (test_prog::races) + * 1: Elf (test_prog::Elf) diff --git a/tests/sav/test_model_index_args11.res b/tests/sav/test_model_index_args11.res index 02cba00..b8eaa33 100644 --- a/tests/sav/test_model_index_args11.res +++ b/tests/sav/test_model_index_args11.res @@ -1,12 +1,3 @@ -# Dwarves +# test_prog::Dwarv - * 12: Sys (test_prog::Sys) - * 8: excluded (excluded>) - * 7: excluded (excluded) - * 13: game (test_prog>game>) - * 13: man (test_prog>man>) - * 13: races (test_prog::races) - * 13: rpg (test_prog>rpg>) - * 13: rpg (test_prog::rpg) - * 9: test_prog (test_prog) - * 9: test_prog (test_prog>) + * 1: Dwarf (test_prog::Dwarf) diff --git a/tests/sav/test_model_index_args12.res b/tests/sav/test_model_index_args12.res index b1ae3db..492b372 100644 --- a/tests/sav/test_model_index_args12.res +++ b/tests/sav/test_model_index_args12.res @@ -1,12 +1,3 @@ -# test_prof::Dwarves +# test_prof::Dwarf - * 5: Career (test_prog::Career) - * 4: Dwarf (test_prog::Dwarf) - * 6: Game (test_prog::Game) - * 6: Race (test_prog::Race) - * 5: Starter (test_prog::Starter) - * 5: careers (test_prog::careers) - * 7: character (test_prog::character) - * 6: game (test_prog::game) - * 5: races (test_prog::races) - * 7: rpg (test_prog::rpg) + * 1: Dwarf (test_prog::Dwarf) diff --git a/tests/sav/test_model_index_args13.res b/tests/sav/test_model_index_args13.res index fe5bfd3..62bdafb 100644 --- a/tests/sav/test_model_index_args13.res +++ b/tests/sav/test_model_index_args13.res @@ -1,12 +1,3 @@ # Obj - * 3: + (test_prog::Int::+) - * 3: > (test_prog::Int::>) - * 3: Elf (test_prog::Elf) - * 3: Int (test_prog::Int) * 1: Object (test_prog::Object) - * 3: Sys (test_prog::Sys) - * 3: age (test_prog::Character::age) - * 3: man (test_prog>man>) - * 3: rpg (test_prog::rpg) - * 3: rpg (test_prog>rpg>) diff --git a/tests/sav/test_model_index_args14.res b/tests/sav/test_model_index_args14.res index 3fa271e..806088f 100644 --- a/tests/sav/test_model_index_args14.res +++ b/tests/sav/test_model_index_args14.res @@ -1,12 +1,12 @@ # C - * 1: * (test_prog::Float::*) * 1: * (test_prog::Int::*) + * 1: * (test_prog::Float::*) + * 1: + (test_prog::Int::+) * 1: + (test_prog::Float::+) - * 1: - (test_prog::Int::-) * 1: - (test_prog::Float::-) + * 1: - (test_prog::Int::-) * 1: / (test_prog::Float::/) * 1: / (test_prog::Int::/) - * 1: > (test_prog::Int::>) * 1: > (test_prog::Float::>) * 1: Career (test_prog::Career) diff --git a/tests/sav/test_model_index_args15.res b/tests/sav/test_model_index_args15.res index 65b6c73..dda5763 100644 --- a/tests/sav/test_model_index_args15.res +++ b/tests/sav/test_model_index_args15.res @@ -1,12 +1,6 @@ # to - * 2: * (test_prog::Float::*) - * 2: + (test_prog::Float::+) - * 2: - (test_prog::Float::-) - * 2: / (test_prog::Float::/) - * 2: / (test_prog::Int::/) - * 2: == (test_prog::Object::==) - * 2: > (test_prog::Int::>) - * 2: > (test_prog::Float::>) * 1: to_f (test_prog::Int::to_f) + * 3: total_endurance (test_prog::Character::total_endurance) + * 4: total_intelligence (test_prog::Character::total_intelligence) * 2: total_strengh (test_prog::Character::total_strengh) diff --git a/tests/sav/test_model_index_args16.res b/tests/sav/test_model_index_args16.res index bd3e0ad..7e420df 100644 --- a/tests/sav/test_model_index_args16.res +++ b/tests/sav/test_model_index_args16.res @@ -1,12 +1,3 @@ -# Dwa +# test_prog::Dwar - * 13: Dwarf (test_prog::Dwarf) - * 9: excluded (excluded>) - * 8: excluded (excluded) - * 14: game (test_prog>game>) - * 14: game (test_prog::game) - * 13: man (test_prog>man>) - * 14: rpg (test_prog>rpg>) - * 14: rpg (test_prog::rpg) - * 10: test_prog (test_prog>) - * 9: test_prog (test_prog) + * 1: Dwarf (test_prog::Dwarf) diff --git a/tests/sav/test_model_index_args17.res b/tests/sav/test_model_index_args17.res index 89e9bc8..5ee70f9 100644 --- a/tests/sav/test_model_index_args17.res +++ b/tests/sav/test_model_index_args17.res @@ -3,10 +3,10 @@ * 1: Career (test_prog::Career) * 2: Character (test_prog::Character) * 3: Combatable (test_prog::Combatable) - * 3: Elf (test_prog::Elf) - * 3: Int (test_prog::Int) - * 3: Sys (test_prog::Sys) - * 4: game (test_prog::game) - * 3: rpg (test_prog::rpg) - * 3: test_prog (test_prog) - * 3: test_prog (test_prog>) + * 4: age (test_prog::Character::age) + * 8: name (test_prog::Character::name) + * 7: quit (test_prog::Character::quit) + * 6: race (test_prog::Character::race) + * 5: sex (test_prog::Character::sex) + * 9: age= (test_prog::Character::age=) + * 10: sex= (test_prog::Character::sex=) diff --git a/tests/sav/test_model_index_args18.res b/tests/sav/test_model_index_args18.res index 3fa271e..806088f 100644 --- a/tests/sav/test_model_index_args18.res +++ b/tests/sav/test_model_index_args18.res @@ -1,12 +1,12 @@ # C - * 1: * (test_prog::Float::*) * 1: * (test_prog::Int::*) + * 1: * (test_prog::Float::*) + * 1: + (test_prog::Int::+) * 1: + (test_prog::Float::+) - * 1: - (test_prog::Int::-) * 1: - (test_prog::Float::-) + * 1: - (test_prog::Int::-) * 1: / (test_prog::Float::/) * 1: / (test_prog::Int::/) - * 1: > (test_prog::Int::>) * 1: > (test_prog::Float::>) * 1: Career (test_prog::Career) diff --git a/tests/sav/test_model_index_args19.res b/tests/sav/test_model_index_args19.res index d2cf349..dda5763 100644 --- a/tests/sav/test_model_index_args19.res +++ b/tests/sav/test_model_index_args19.res @@ -1,12 +1,6 @@ # to - * 2: * (test_prog::Int::*) - * 2: * (test_prog::Float::*) - * 2: + (test_prog::Float::+) - * 2: - (test_prog::Float::-) - * 2: / (test_prog::Float::/) - * 2: / (test_prog::Int::/) - * 2: > (test_prog::Float::>) - * 2: > (test_prog::Int::>) * 1: to_f (test_prog::Int::to_f) + * 3: total_endurance (test_prog::Character::total_endurance) + * 4: total_intelligence (test_prog::Character::total_intelligence) * 2: total_strengh (test_prog::Character::total_strengh) diff --git a/tests/sav/test_model_index_args20.res b/tests/sav/test_model_index_args20.res index 41184bb..735e8ba 100644 --- a/tests/sav/test_model_index_args20.res +++ b/tests/sav/test_model_index_args20.res @@ -1,12 +1,3 @@ -# Foo +# Floot - * 3: * (test_prog::Int::*) - * 2: Bool (test_prog::Bool) - * 3: Elf (test_prog::Elf) - * 3: Float (test_prog::Float) - * 3: Int (test_prog::Int) - * 3: Sys (test_prog::Sys) - * 3: dps (test_prog::Weapon::dps) - * 3: man (test_prog>man>) - * 3: rpg (test_prog>rpg>) - * 3: rpg (test_prog::rpg) + * 1: Float (test_prog::Float) diff --git a/tests/sav/test_model_index_args21.res b/tests/sav/test_model_index_args21.res index afc25c4..5ee70f9 100644 --- a/tests/sav/test_model_index_args21.res +++ b/tests/sav/test_model_index_args21.res @@ -3,10 +3,10 @@ * 1: Career (test_prog::Career) * 2: Character (test_prog::Character) * 3: Combatable (test_prog::Combatable) - * 3: Elf (test_prog::Elf) - * 3: Int (test_prog::Int) - * 3: Sys (test_prog::Sys) - * 3: rpg (test_prog::rpg) - * 3: test_prog (test_prog>) - * 3: test_prog (test_prog::test_prog) - * 3: test_prog (test_prog) + * 4: age (test_prog::Character::age) + * 8: name (test_prog::Character::name) + * 7: quit (test_prog::Character::quit) + * 6: race (test_prog::Character::race) + * 5: sex (test_prog::Character::sex) + * 9: age= (test_prog::Character::age=) + * 10: sex= (test_prog::Character::sex=) diff --git a/tests/sav/test_model_index_args8.res b/tests/sav/test_model_index_args8.res index 6381895..0b99c62 100644 --- a/tests/sav/test_model_index_args8.res +++ b/tests/sav/test_model_index_args8.res @@ -4,8 +4,8 @@ * 1: * (test_prog::Int::*) * 1: + (test_prog::Int::+) * 1: + (test_prog::Float::+) - * 1: - (test_prog::Int::-) * 1: - (test_prog::Float::-) + * 1: - (test_prog::Int::-) * 1: / (test_prog::Int::/) * 1: / (test_prog::Float::/) * 1: > (test_prog::Int::>) diff --git a/tests/sav/test_model_index_args9.res b/tests/sav/test_model_index_args9.res index d8bc532..735e8ba 100644 --- a/tests/sav/test_model_index_args9.res +++ b/tests/sav/test_model_index_args9.res @@ -1,12 +1,3 @@ -# Foo +# Floot - * 2: Bool (test_prog::Bool) - * 3: Elf (test_prog::Elf) - * 3: Float (test_prog::Float) - * 3: Int (test_prog::Int) - * 3: Sys (test_prog::Sys) - * 3: age (test_prog::Character::age) - * 3: dps (test_prog::Weapon::dps) - * 3: man (test_prog>man>) - * 3: rpg (test_prog::rpg) - * 3: rpg (test_prog>rpg>) + * 1: Float (test_prog::Float) diff --git a/tests/test_model_index.args b/tests/test_model_index.args index 62f7bde..7bce83b 100644 --- a/tests/test_model_index.args +++ b/tests/test_model_index.args @@ -6,16 +6,16 @@ test_prog -q C --full-name-prefix --no-color test_prog -q test_prog:: --full-name-prefix --no-color test_prog -q test_prog::C --full-name-prefix --no-color test_prog -q A --name-similarity --no-color -test_prog -q Foo --name-similarity --no-color -test_prog -q elfves --name-similarity --no-color -test_prog -q Dwarves --full-name-similarity --no-color -test_prog -q test_prof::Dwarves --full-name-similarity --no-color +test_prog -q Floot --name-similarity --no-color +test_prog -q elf --name-similarity --no-color +test_prog -q test_prog::Dwarv --full-name-similarity --no-color +test_prog -q test_prof::Dwarf --full-name-similarity --no-color test_prog -q Obj --name --no-color test_prog -q C --name --no-color test_prog -q to --name --no-color -test_prog -q Dwa --full-name --no-color +test_prog -q test_prog::Dwar --full-name --no-color test_prog -q test_prog::C --full-name --no-color test_prog -q C --no-color test_prog -q to --no-color -test_prog -q Foo --no-color +test_prog -q Floot --no-color test_prog -q test_prog::C --no-color -- 1.7.9.5