package threadsapi

import "testing"

func TestIsNumericMediaID(t *testing.T) {
	if !IsNumericMediaID("18123456789012345") {
		t.Fatal("expected numeric media id")
	}
	if IsNumericMediaID("AbCdEf123") {
		t.Fatal("shortcode should not be numeric media id")
	}
}

func TestParsePermalinkParts(t *testing.T) {
	user, code := parsePermalinkParts("https://www.threads.net/@alice/post/AbCdEf123")
	if user != "alice" || code != "AbCdEf123" {
		t.Fatalf("got %q %q", user, code)
	}
}
