// Package sshpush_test contains compile-time assertions that *Transport
// satisfies the emitter.AtomicWriter interface (the Traefik C-10
// atomicity protocol — internal/emitter/traefik_atomic.go). The
// assertion lives here (not in internal/emitter) to avoid an import
// cycle: internal/emitter is imported by this package (fanout.go), so
// internal/emitter cannot import this package.
package sshpush_test

import (
	"context"
	"testing"

	"git.cloudinit.dev/coreci/orca/internal/emitter"
	"git.cloudinit.dev/coreci/orca/internal/sshpush"
)

// Compile-time assertion: *sshpush.Transport satisfies
// emitter.AtomicWriter. WriteTraefikDynamic relies on this so the
// Traefik dynamic-config file is written atomically (gate C-10).
var _ emitter.AtomicWriter = (*sshpush.Transport)(nil)

func TestTransportSatisfiesAtomicWriter(t *testing.T) {
	// A trivial runtime check that the type conversion is valid; the
	// compile-time assertion above is the real test, but this gives
	// `go test` a function to run.
	tr := sshpush.NewTransport("/nonexistent", "/nonexistent")
	var w emitter.AtomicWriter = tr
	_ = w
	_ = context.Background()
}
