initial commits

master
Charles Iliya Krempeaux 2024-02-14 16:37:13 -08:00
parent 804c759fb5
commit 27e70020b2
1 changed files with 10 additions and 10 deletions

View File

@ -7,39 +7,39 @@ import (
func TestAppendFramePostURL(t *testing.T) { func TestAppendFramePostURL(t *testing.T) {
tests := []struct{ tests := []struct{
Version string URL string
Expected string Expected string
}{ }{
{ {
Version: "", URL: "",
Expected: `<meta property="fc:frame:post_url" content="" />`+"\n", Expected: `<meta property="fc:frame:post_url" content="" />`+"\n",
}, },
{ {
Version: "something", URL: "something",
Expected: `<meta property="fc:frame:post_url" content="something" />`+"\n", Expected: `<meta property="fc:frame:post_url" content="something" />`+"\n",
}, },
{ {
Version: "Hello world! 🙂", URL: "Hello world! 🙂",
Expected: `<meta property="fc:frame:post_url" content="Hello world! 🙂" />`+"\n", Expected: `<meta property="fc:frame:post_url" content="Hello world! 🙂" />`+"\n",
}, },
{ {
Version: "https://example.com/path/to/post/to.php", URL: "https://example.com/path/to/post/to.php",
Expected: `<meta property="fc:frame:post_url" content="https://example.com/path/to/post/to.php" />`+"\n", Expected: `<meta property="fc:frame:post_url" content="https://example.com/path/to/post/to.php" />`+"\n",
}, },
{ {
Version: "x-proto:apple/banana/cherry", URL: "x-proto:apple/banana/cherry",
Expected: `<meta property="fc:frame:post_url" content="x-proto:apple/banana/cherry" />`+"\n", Expected: `<meta property="fc:frame:post_url" content="x-proto:apple/banana/cherry" />`+"\n",
}, },
} }
@ -50,7 +50,7 @@ func TestAppendFramePostURL(t *testing.T) {
var buffer [256]byte var buffer [256]byte
var p []byte = buffer[0:0] var p []byte = buffer[0:0]
p = AppendFramePostURL(p, test.Version) p = AppendFramePostURL(p, test.URL)
expected := test.Expected expected := test.Expected
actual := string(p) actual := string(p)
@ -61,7 +61,7 @@ func TestAppendFramePostURL(t *testing.T) {
t.Logf("ACTUAL: %s", actual) t.Logf("ACTUAL: %s", actual)
t.Logf("EXPECTED: %q", expected) t.Logf("EXPECTED: %q", expected)
t.Logf("ACTUAL: %q", actual) t.Logf("ACTUAL: %q", actual)
t.Logf("LABEL: %q", test.Version) t.Logf("URL: %q", test.URL)
continue continue
} }
} }
@ -75,7 +75,7 @@ func TestAppendFramePostURL(t *testing.T) {
p = append(p, top...) p = append(p, top...)
p = AppendFramePostURL(p, test.Version) p = AppendFramePostURL(p, test.URL)
p = append(p, bottom...) p = append(p, bottom...)
@ -88,7 +88,7 @@ func TestAppendFramePostURL(t *testing.T) {
t.Logf("ACTUAL: %s", actual) t.Logf("ACTUAL: %s", actual)
t.Logf("EXPECTED: %q", expected) t.Logf("EXPECTED: %q", expected)
t.Logf("ACTUAL: %q", actual) t.Logf("ACTUAL: %q", actual)
t.Logf("LABEL: %q", test.Version) t.Logf("URL: %q", test.URL)
continue continue
} }
} }