| 
									
										
										
										
											2016-01-23 19:19:26 +01:00
										 |  |  | package mem_test | 
					
						
							| 
									
										
										
										
											2016-01-23 17:42:26 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							| 
									
										
										
										
											2017-05-01 22:56:05 +02:00
										 |  |  | 	"testing" | 
					
						
							| 
									
										
										
										
											2016-08-31 22:51:35 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-23 14:21:03 +02:00
										 |  |  | 	"github.com/restic/restic/internal/backend/mem" | 
					
						
							|  |  |  | 	"github.com/restic/restic/internal/backend/test" | 
					
						
							| 
									
										
										
										
											2016-01-23 17:42:26 +01:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-08 16:53:55 +02:00
										 |  |  | func newTestSuite() *test.Suite[struct{}] { | 
					
						
							|  |  |  | 	return &test.Suite[struct{}]{ | 
					
						
							| 
									
										
										
										
											2017-05-01 22:56:05 +02:00
										 |  |  | 		// NewConfig returns a config for a new temporary backend that will be used in tests. | 
					
						
							| 
									
										
										
										
											2023-06-08 16:53:55 +02:00
										 |  |  | 		NewConfig: func() (*struct{}, error) { | 
					
						
							|  |  |  | 			return &struct{}{}, nil | 
					
						
							| 
									
										
										
										
											2017-05-01 22:56:05 +02:00
										 |  |  | 		}, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-06-08 16:53:55 +02:00
										 |  |  | 		Factory: mem.NewFactory(), | 
					
						
							| 
									
										
										
										
											2016-01-23 17:42:26 +01:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2017-05-13 21:47:01 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func TestSuiteBackendMem(t *testing.T) { | 
					
						
							|  |  |  | 	newTestSuite().RunTests(t) | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2016-01-23 17:42:26 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-13 21:47:01 +02:00
										 |  |  | func BenchmarkSuiteBackendMem(t *testing.B) { | 
					
						
							|  |  |  | 	newTestSuite().RunBenchmarks(t) | 
					
						
							| 
									
										
										
										
											2016-01-23 17:42:26 +01:00
										 |  |  | } |