2
2
3
3
const CacheContent = require ( '../util/cache-content' )
4
4
const memo = require ( '../../lib/memoization' )
5
+ const path = require ( 'path' )
5
6
const Tacks = require ( 'tacks' )
6
7
const ssri = require ( 'ssri' )
7
8
@@ -77,7 +78,7 @@ module.exports = (suite, CACHE) => {
77
78
}
78
79
} )
79
80
80
- suite . add ( 'get.stream() big data' , {
81
+ suite . add ( 'get.stream.byDigest () big data' , {
81
82
defer : true ,
82
83
setup ( ) {
83
84
const fixture = new Tacks ( CacheContent ( {
@@ -94,4 +95,38 @@ module.exports = (suite, CACHE) => {
94
95
} )
95
96
}
96
97
} )
98
+
99
+ suite . add ( 'get.copy.byDigest() small data' , {
100
+ defer : true ,
101
+ setup ( ) {
102
+ const fixture = new Tacks ( CacheContent ( {
103
+ [ INTEGRITY ] : CONTENT
104
+ } ) )
105
+ fixture . create ( CACHE )
106
+ } ,
107
+ fn ( deferred ) {
108
+ get . copy . byDigest ( CACHE , INTEGRITY , path . join ( CACHE , 'data' ) )
109
+ . then (
110
+ ( ) => deferred . resolve ( ) ,
111
+ err => deferred . reject ( err )
112
+ )
113
+ }
114
+ } )
115
+
116
+ suite . add ( 'get.copy.byDigest() big data' , {
117
+ defer : true ,
118
+ setup ( ) {
119
+ const fixture = new Tacks ( CacheContent ( {
120
+ [ BIGINTEGRITY ] : BIGCONTENT
121
+ } ) )
122
+ fixture . create ( CACHE )
123
+ } ,
124
+ fn ( deferred ) {
125
+ get . copy . byDigest ( CACHE , BIGINTEGRITY , path . join ( CACHE , 'data' ) )
126
+ . then (
127
+ ( ) => deferred . resolve ( ) ,
128
+ err => deferred . reject ( err )
129
+ )
130
+ }
131
+ } )
97
132
}
0 commit comments