@@ -718,7 +718,7 @@ func TestSetBlob(t *testing.T) {
718
718
require .Equal (t , "" , string (snapRef .getBlob ()))
719
719
require .Equal (t , "" , string (snapRef .getChainID ()))
720
720
require .Equal (t , "" , string (snapRef .getBlobChainID ()))
721
- require .Equal (t , ! snapRef .getBlobOnly (), true )
721
+ require .Equal (t , true , ! snapRef .getBlobOnly ())
722
722
723
723
ctx , clean , err := leaseutil .WithLease (ctx , co .lm )
724
724
require .NoError (t , err )
@@ -750,7 +750,7 @@ func TestSetBlob(t *testing.T) {
750
750
require .Equal (t , snapRef .getDiffID (), snapRef .getChainID ())
751
751
require .Equal (t , digest .FromBytes ([]byte (desc .Digest + " " + snapRef .getDiffID ())), snapRef .getBlobChainID ())
752
752
require .Equal (t , snap .ID (), snapRef .getSnapshotID ())
753
- require .Equal (t , ! snapRef .getBlobOnly (), true )
753
+ require .Equal (t , true , ! snapRef .getBlobOnly ())
754
754
755
755
active , err = cm .New (ctx , snap , nil )
756
756
require .NoError (t , err )
@@ -776,7 +776,7 @@ func TestSetBlob(t *testing.T) {
776
776
require .Equal (t , digest .FromBytes ([]byte (snapRef .getChainID ()+ " " + snapRef2 .getDiffID ())), snapRef2 .getChainID ())
777
777
require .Equal (t , digest .FromBytes ([]byte (snapRef .getBlobChainID ()+ " " + digest .FromBytes ([]byte (desc2 .Digest + " " + snapRef2 .getDiffID ())))), snapRef2 .getBlobChainID ())
778
778
require .Equal (t , snap2 .ID (), snapRef2 .getSnapshotID ())
779
- require .Equal (t , ! snapRef2 .getBlobOnly (), true )
779
+ require .Equal (t , true , ! snapRef2 .getBlobOnly ())
780
780
781
781
b3 , desc3 , err := mapToBlob (map [string ]string {"foo3" : "bar3" }, true )
782
782
require .NoError (t , err )
@@ -794,7 +794,7 @@ func TestSetBlob(t *testing.T) {
794
794
require .Equal (t , digest .FromBytes ([]byte (snapRef .getChainID ()+ " " + snapRef3 .getDiffID ())), snapRef3 .getChainID ())
795
795
require .Equal (t , digest .FromBytes ([]byte (snapRef .getBlobChainID ()+ " " + digest .FromBytes ([]byte (desc3 .Digest + " " + snapRef3 .getDiffID ())))), snapRef3 .getBlobChainID ())
796
796
require .Equal (t , string (snapRef3 .getChainID ()), snapRef3 .getSnapshotID ())
797
- require .Equal (t , ! snapRef3 .getBlobOnly (), false )
797
+ require .Equal (t , false , ! snapRef3 .getBlobOnly ())
798
798
799
799
// snap4 is same as snap2
800
800
snap4 , err := cm .GetByBlob (ctx , desc2 , snap )
@@ -840,7 +840,7 @@ func TestSetBlob(t *testing.T) {
840
840
require .Equal (t , digest .FromBytes ([]byte (snapRef3 .getChainID ()+ " " + snapRef6 .getDiffID ())), snapRef6 .getChainID ())
841
841
require .Equal (t , digest .FromBytes ([]byte (snapRef3 .getBlobChainID ()+ " " + digest .FromBytes ([]byte (snapRef6 .getBlob ()+ " " + snapRef6 .getDiffID ())))), snapRef6 .getBlobChainID ())
842
842
require .Equal (t , string (snapRef6 .getChainID ()), snapRef6 .getSnapshotID ())
843
- require .Equal (t , ! snapRef6 .getBlobOnly (), false )
843
+ require .Equal (t , false , ! snapRef6 .getBlobOnly ())
844
844
845
845
_ , err = cm .GetByBlob (ctx , ocispecs.Descriptor {
846
846
Digest : digest .FromBytes ([]byte ("notexist" )),
@@ -901,7 +901,7 @@ func TestPrune(t *testing.T) {
901
901
require .NoError (t , err )
902
902
903
903
checkDiskUsage (ctx , t , cm , 2 , 0 )
904
- require .Equal (t , len (buf .all ), 0 )
904
+ require .Equal (t , 0 , len (buf .all ))
905
905
906
906
dirs , err = os .ReadDir (filepath .Join (tmpdir , "snapshots/snapshots" ))
907
907
require .NoError (t , err )
@@ -919,7 +919,7 @@ func TestPrune(t *testing.T) {
919
919
require .NoError (t , err )
920
920
921
921
checkDiskUsage (ctx , t , cm , 1 , 0 )
922
- require .Equal (t , len (buf .all ), 1 )
922
+ require .Equal (t , 1 , len (buf .all ))
923
923
924
924
dirs , err = os .ReadDir (filepath .Join (tmpdir , "snapshots/snapshots" ))
925
925
require .NoError (t , err )
@@ -946,7 +946,7 @@ func TestPrune(t *testing.T) {
946
946
require .NoError (t , err )
947
947
948
948
checkDiskUsage (ctx , t , cm , 2 , 0 )
949
- require .Equal (t , len (buf .all ), 0 )
949
+ require .Equal (t , 0 , len (buf .all ))
950
950
951
951
// releasing last reference
952
952
err = snap2 .Release (ctx )
@@ -959,7 +959,7 @@ func TestPrune(t *testing.T) {
959
959
require .NoError (t , err )
960
960
961
961
checkDiskUsage (ctx , t , cm , 0 , 0 )
962
- require .Equal (t , len (buf .all ), 2 )
962
+ require .Equal (t , 2 , len (buf .all ))
963
963
964
964
dirs , err = os .ReadDir (filepath .Join (tmpdir , "snapshots/snapshots" ))
965
965
require .NoError (t , err )
@@ -1848,7 +1848,7 @@ func TestGetRemotes(t *testing.T) {
1848
1848
func checkVariantsCoverage (ctx context.Context , t * testing.T , variants idxToVariants , idx int , remotes []* solver.Remote , expectCompression * compression.Type ) {
1849
1849
if idx < 0 {
1850
1850
for _ , r := range remotes {
1851
- require .Equal (t , len (r .Descriptors ), 0 )
1851
+ require .Equal (t , 0 , len (r .Descriptors ))
1852
1852
}
1853
1853
return
1854
1854
}
@@ -2081,7 +2081,7 @@ func TestMergeOp(t *testing.T) {
2081
2081
ms , unmount , err := m .Mount ()
2082
2082
require .NoError (t , err )
2083
2083
require .Len (t , ms , 1 )
2084
- require .Equal (t , ms [0 ].Type , "bind" )
2084
+ require .Equal (t , "bind" , ms [0 ].Type )
2085
2085
err = fstest .CheckDirectoryEqualWithApplier (ms [0 ].Source , fstest .Apply (
2086
2086
fstest .CreateFile (strconv .Itoa (0 ), []byte (strconv .Itoa (0 )), 0777 ),
2087
2087
))
0 commit comments