2023-06-23 16:50:01 +08:00
|
|
|
//go:build !plan9 && !solaris && !js
|
|
|
|
// +build !plan9,!solaris,!js
|
2018-09-11 09:55:06 +08:00
|
|
|
|
|
|
|
package azureblob
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (f *Fs) InternalTest(t *testing.T) {
|
|
|
|
// Check first feature flags are set on this
|
|
|
|
// remote
|
2018-09-18 20:25:20 +08:00
|
|
|
enabled := f.Features().SetTier
|
2018-09-11 09:55:06 +08:00
|
|
|
assert.True(t, enabled)
|
|
|
|
enabled = f.Features().GetTier
|
|
|
|
assert.True(t, enabled)
|
|
|
|
}
|
2020-05-14 04:29:21 +08:00
|
|
|
|
|
|
|
func TestIncrement(t *testing.T) {
|
|
|
|
for _, test := range []struct {
|
2023-08-16 23:59:39 +08:00
|
|
|
in [8]byte
|
|
|
|
want [8]byte
|
2020-05-14 04:29:21 +08:00
|
|
|
}{
|
2023-08-16 23:59:39 +08:00
|
|
|
{[8]byte{0, 0, 0, 0}, [8]byte{1, 0, 0, 0}},
|
|
|
|
{[8]byte{0xFE, 0, 0, 0}, [8]byte{0xFF, 0, 0, 0}},
|
|
|
|
{[8]byte{0xFF, 0, 0, 0}, [8]byte{0, 1, 0, 0}},
|
|
|
|
{[8]byte{0, 1, 0, 0}, [8]byte{1, 1, 0, 0}},
|
|
|
|
{[8]byte{0xFF, 0xFF, 0xFF, 0xFE}, [8]byte{0, 0, 0, 0xFF}},
|
|
|
|
{[8]byte{0xFF, 0xFF, 0xFF, 0xFF}, [8]byte{0, 0, 0, 0, 1}},
|
|
|
|
{[8]byte{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, [8]byte{0, 0, 0, 0, 0, 0, 0}},
|
2020-05-14 04:29:21 +08:00
|
|
|
} {
|
2023-08-16 23:59:39 +08:00
|
|
|
increment(&test.in)
|
2020-05-14 04:29:21 +08:00
|
|
|
assert.Equal(t, test.want, test.in)
|
|
|
|
}
|
|
|
|
}
|