package frameproto import ( "testing" "strings" ) func TestWriteFrameImageAspectRatio(t *testing.T) { tests := []struct{ AspectRatio string Expected string }{ { AspectRatio: "", Expected: ``+"\n", }, { AspectRatio: "something", Expected: ``+"\n", }, { AspectRatio: "Hello world! 🙂", Expected: ``+"\n", }, { AspectRatio: "1.91:1", Expected: ``+"\n", }, { AspectRatio: "1:1", Expected: ``+"\n", }, } for testNumber, test := range tests { var buffer strings.Builder WriteFrameImageAspectRatio(&buffer, test.AspectRatio) expected := test.Expected actual := buffer.String() if expected != actual { t.Errorf("For test #%d, the actual written meta-tag is not what was expected." ,testNumber) t.Logf("EXPECTED: %s", expected) t.Logf("ACTUAL: %s", actual) t.Logf("EXPECTED: %q", expected) t.Logf("ACTUAL: %q", actual) t.Logf("AspectRatio: %q", test.AspectRatio) continue } } }