mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Make testlogger output "TestLogger" prefix (#24683)
Make testlogger output "TestLogger" prefix instead of "Unknown Test" when there is no running test case.
This commit is contained in:
		@@ -58,7 +58,9 @@ func (w *testLoggerWriterCloser) Write(p []byte) (int, error) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if t == nil || *t == nil {
 | 
			
		||||
		return fmt.Fprintf(os.Stdout, "??? [Unknown Test] %s\n", p)
 | 
			
		||||
		// if there is no running test, the log message should be outputted to console, to avoid losing important information.
 | 
			
		||||
		// the "???" prefix is used to match the "===" and "+++" in PrintCurrentTest
 | 
			
		||||
		return fmt.Fprintf(os.Stdout, "??? [TestLogger] %s\n", p)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	defer func() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user