mirror of
				https://github.com/TeaOSLab/EdgeAPI.git
				synced 2025-11-04 07:50:25 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			571 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			571 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
 | 
						|
 | 
						|
package models_test
 | 
						|
 | 
						|
import (
 | 
						|
	"github.com/TeaOSLab/EdgeAPI/internal/db/models"
 | 
						|
	"testing"
 | 
						|
)
 | 
						|
 | 
						|
func TestNewSysLockerIncrement(t *testing.T) {
 | 
						|
	var increment = models.NewSysLockerIncrement(10)
 | 
						|
	increment.Push("key", 1, 10)
 | 
						|
	t.Log(increment.MaxValue("key"))
 | 
						|
	for i := 0; i < 11; i++ {
 | 
						|
		result, value := increment.Pop("key")
 | 
						|
		t.Log(i, "=>", result, value)
 | 
						|
	}
 | 
						|
 | 
						|
	for i := 0; i < 11; i++ {
 | 
						|
		result, value := increment.Pop("key1")
 | 
						|
		t.Log(i, "=>", result, value)
 | 
						|
	}
 | 
						|
}
 |