Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

624 B
Raw Blame
package agentruntimestate

import (
	"errors"
	"testing"
)

func TestMetaContextCursorRoundTripAndValidation(t *testing.T) {
	const agentManagementID = "agent-reviewer"
	cursor := encodeMetaContextCursor(agentManagementID)
	decoded, err := decodeMetaContextCursor(cursor)
	if err != nil || decoded != agentManagementID {
		t.Fatalf("decode meta Context cursor=%q value=%q err=%v", cursor, decoded, err)
	}
	for _, invalid := range []string{"invalid!", "_w"} {
		if _, err := decodeMetaContextCursor(invalid); !errors.Is(err, ErrInvalid) {
			t.Fatalf("decode invalid meta Context cursor %q error=%v", invalid, err)
		}
	}
}