mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-10-28 10:51:44 +01:00 
			
		
		
		
	This is step one in detaching the Database layer from Headscale (h). The ultimate goal is to have all function that does database operations in its own package, and keep the business logic and writing separate. Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
		
			
				
	
	
		
			16 lines
		
	
	
		
			255 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			255 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package util
 | |
| 
 | |
| import (
 | |
| 	"testing"
 | |
| 
 | |
| 	"github.com/stretchr/testify/assert"
 | |
| )
 | |
| 
 | |
| func TestGenerateRandomStringDNSSafe(t *testing.T) {
 | |
| 	for i := 0; i < 100000; i++ {
 | |
| 		str, err := GenerateRandomStringDNSSafe(8)
 | |
| 		assert.Nil(t, err)
 | |
| 		assert.Len(t, str, 8)
 | |
| 	}
 | |
| }
 |