package drive

import "testing"

func TestQuotaAllowsUploadUnlimited(t *testing.T) {
	if !quotaAllowsUpload(-3, 1<<30, 0) {
		t.Fatal("negative free (unlimited) should allow upload")
	}
}

func TestQuotaAllowsUploadZeroFree(t *testing.T) {
	if quotaAllowsUpload(0, 1, 0) {
		t.Fatal("zero free should block upload")
	}
}

func TestQuotaAllowsUploadInsufficient(t *testing.T) {
	if quotaAllowsUpload(100, 95, 10) {
		t.Fatal("upload exceeding free+reserve should be blocked")
	}
	if !quotaAllowsUpload(100, 90, 10) {
		t.Fatal("upload within free+reserve should be allowed")
	}
}
