doc/commands: do not accept empty CmdEntity names
authorAlexandre Terrasa <alexandre@moz-code.org>
Tue, 1 May 2018 19:33:35 +0000 (15:33 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Wed, 2 May 2018 23:03:34 +0000 (19:03 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/doc/commands/commands_base.nit
src/doc/term/tests/test_term.sav/test_mentity_empty.res

index fce0b61..4a94208 100644 (file)
@@ -138,7 +138,7 @@ class CmdEntity
                end
 
                var mentity_name = self.mentity_name
-               if mentity_name == null then return new ErrorMEntityNoName
+               if mentity_name == null or mentity_name.is_empty then return new ErrorMEntityNoName
 
                mentity = view.mentity_by_full_name(mentity_name)
                if mentity == null then
index eed622c..38df9d0 100644 (file)
@@ -1,17 +1,2 @@
-No result found for ``...
-
-Did you mean?
-
- + test_prog::Int::*
-   intern fun *(i: Int): Int
-   test_location
-
- + test_prog::Float::*
-   intern fun *(f: Float): Float
-   test_location
-
- + test_prog::Float::+
-   intern fun +(f: Float): Float
-   test_location
-
+Error: Empty command name