diff --git a/ean/encoder_test.go b/ean/encoder_test.go
new file mode 100644
index 0000000..e2d1e2c
--- /dev/null
+++ b/ean/encoder_test.go
@@ -0,0 +1,23 @@
+package ean
+
+import (
+	"image/color"
+	"testing"
+)
+
+func Test_EncodeEAN13(t *testing.T) {
+	testResult := "10100010110100111011001100100110111101001110101010110011011011001000010101110010011101000100101"
+	testCode := "5901234123457"
+	code, err := Encode(testCode)
+	if err != nil {
+		t.Error(err)
+	}
+	if code.Metadata().Dimensions != 1 || code.Content() != testCode || code.Metadata().CodeKind != "EAN 13" {
+		t.Error("Metadata missmatch")
+	}
+	for i, r := range testResult {
+		if (code.At(i, 0) == color.Black) != (r == '1') {
+			t.Fail()
+		}
+	}
+}