initial commits
parent
804c759fb5
commit
27e70020b2
|
@ -7,39 +7,39 @@ import (
|
|||
func TestAppendFramePostURL(t *testing.T) {
|
||||
|
||||
tests := []struct{
|
||||
Version string
|
||||
URL string
|
||||
Expected string
|
||||
}{
|
||||
{
|
||||
Version: "",
|
||||
URL: "",
|
||||
Expected: `<meta property="fc:frame:post_url" content="" />`+"\n",
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
Version: "something",
|
||||
URL: "something",
|
||||
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",
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
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",
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
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",
|
||||
},
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ func TestAppendFramePostURL(t *testing.T) {
|
|||
var buffer [256]byte
|
||||
var p []byte = buffer[0:0]
|
||||
|
||||
p = AppendFramePostURL(p, test.Version)
|
||||
p = AppendFramePostURL(p, test.URL)
|
||||
|
||||
expected := test.Expected
|
||||
actual := string(p)
|
||||
|
@ -61,7 +61,7 @@ func TestAppendFramePostURL(t *testing.T) {
|
|||
t.Logf("ACTUAL: %s", actual)
|
||||
t.Logf("EXPECTED: %q", expected)
|
||||
t.Logf("ACTUAL: %q", actual)
|
||||
t.Logf("LABEL: %q", test.Version)
|
||||
t.Logf("URL: %q", test.URL)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ func TestAppendFramePostURL(t *testing.T) {
|
|||
|
||||
p = append(p, top...)
|
||||
|
||||
p = AppendFramePostURL(p, test.Version)
|
||||
p = AppendFramePostURL(p, test.URL)
|
||||
|
||||
p = append(p, bottom...)
|
||||
|
||||
|
@ -88,7 +88,7 @@ func TestAppendFramePostURL(t *testing.T) {
|
|||
t.Logf("ACTUAL: %s", actual)
|
||||
t.Logf("EXPECTED: %q", expected)
|
||||
t.Logf("ACTUAL: %q", actual)
|
||||
t.Logf("LABEL: %q", test.Version)
|
||||
t.Logf("URL: %q", test.URL)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue