package api
import (
"context"
"testing"
"craftdesign.group/quarry/internal/ops"
)
// A person signed in builds on the reader lane; a runner reading with
// a sync or run token is CI's work and keeps the lane it had unsigned.
func TestARunnersArchiveKeepsItsLane(t *testing.T) {
person := ops.WithUser(context.Background(), "dan")
runner := ops.WithArchiveReader(person, "repo")
if !readerLane(person) {
t.Errorf("FAIL: a signed-in person is not on the reader lane")
}
if readerLane(runner) || readerLane(context.Background()) {
t.Errorf("FAIL: a token reader or an anonymous one is on the reader lane")
}
if !t.Failed() {
t.Log("ok")
}
}