assert cmd.results.as(not null).first isa MPackage
end
+ fun test_cmd_catalog_search_without_filter is test do
+ var cmd = new CmdCatalogSearch(test_model, test_catalog, query = "MyGame")
+ var res = cmd.init_command
+ assert res isa CmdSuccess
+ assert cmd.results.as(not null).first.full_name == "test_prog::MyGame"
+ assert cmd.results.as(not null).first isa MClass
+ end
+
+ 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 res = cmd.init_command
+ assert res isa CmdSuccess
+ assert cmd.results.as(not null).first.full_name == "test_prog::Game" # not MyGame
+ assert cmd.results.as(not null).first isa MClass
+ end
+
fun test_cmd_catalog_stats is test do
var cmd = new CmdCatalogStats(test_model, test_catalog)
var res = cmd.init_command
assert cmd.results.as(not null).length == 3
end
+ fun test_cmd_children_without_filter is test do
+ var cmd = new CmdDescendants(test_model, test_main, mentity_name = "test_prog::Game")
+ var res = cmd.init_command
+ assert res isa CmdSuccess
+ assert cmd.results.as(not null).length == 2
+ end
+
+ fun test_cmd_children_with_filter_example is test do
+ var filter = new ModelFilter(accept_example = false)
+ var cmd = new CmdDescendants(test_model, test_main, filter, mentity_name = "test_prog::Game")
+ var res = cmd.init_command
+ assert res isa CmdSuccess
+ assert cmd.results.as(not null).length == 1
+ end
+
+ fun test_cmd_children_with_filter_match is test do
+ var filter = new ModelFilter(accept_full_name = "MyGame")
+ var cmd = new CmdDescendants(test_model, test_main, filter, mentity_name = "test_prog::Game")
+ var res = cmd.init_command
+ assert res isa CmdSuccess
+ assert cmd.results.as(not null).length == 1
+ end
+
fun test_cmd_descendants is test do
var cmd = new CmdDescendants(test_model, test_main, mentity_name = "test_prog::Career", children = false)
var res = cmd.init_command
assert cmd.results.as(not null).length == 10
end
+ fun test_cmd_features_with_filter_attribute is test do
+ var filter = new ModelFilter(accept_attribute = false)
+ var cmd = new CmdFeatures(test_model, filter, mentity_name = "test_prog::Career")
+ var res = cmd.init_command
+ assert res isa CmdSuccess
+ assert cmd.results.as(not null).length == 7
+ end
+
+ fun test_cmd_features_with_filter_public is test do
+ var filter = new ModelFilter(min_visibility = public_visibility)
+ var cmd = new CmdFeatures(test_model, filter, mentity_name = "test_prog::Career")
+ var res = cmd.init_command
+ assert res isa CmdSuccess
+ assert cmd.results.as(not null).length == 4
+ end
+
+ fun test_cmd_features_with_filter_match is test do
+ var filter = new ModelFilter(accept_full_name = "endurance")
+ var cmd = new CmdFeatures(test_model, 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_features_with_filter_inh is test do
+ var context = test_model.mentity_by_full_name("test_prog::TestGame").as(not null)
+ var filter = new ModelFilter(accept_inherited = context)
+ var cmd = new CmdFeatures(test_model, filter, mentity_name = "test_prog::TestGame")
+ var res = cmd.init_command
+ assert res isa CmdSuccess
+ assert cmd.results.as(not null).length == 3
+ end
+
fun test_cmd_features_no_features is test do
var cmd = new CmdFeatures(test_model, mentity_name = "test_prog$Career$strength_bonus")
var res = cmd.init_command
var cmd = new CmdModelEntities(test_model, kind = "modules")
var res = cmd.init_command
assert res isa CmdSuccess
- assert cmd.results.as(not null).length == 10
+ assert cmd.results.as(not null).length == 11
+ end
+
+ fun test_cmd_results_with_filter is test do
+ var filter = new ModelFilter(accept_test = false, accept_example = false)
+ var cmd = new CmdModelEntities(test_model, filter, kind = "modules")
+ var res = cmd.init_command
+ assert res isa CmdSuccess
+ print cmd.results.as(not null)
+ assert cmd.results.as(not null).length == 9
end
fun test_cmd_results_random is test do