mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			327 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			327 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package command
 | |
| 
 | |
| import "testing"
 | |
| 
 | |
| func TestCommandDefault(t *testing.T) {
 | |
| 	var (
 | |
| 		cmds = Commands{make(map[string]cmdfunc)}
 | |
| 		cmd  = cmds.Find("non-existant-command")
 | |
| 	)
 | |
| 
 | |
| 	err := cmd()
 | |
| 	if err == nil {
 | |
| 		t.Fatal("cmd() did not default")
 | |
| 	}
 | |
| 
 | |
| 	if err.Error() != "command not available" {
 | |
| 		t.Fatal("wrong command output")
 | |
| 	}
 | |
| }
 | 
