// Test functions // TODO: We need tests of type 0, type 2, type 3, type 4 functions. Particularly type 0 is complex and // needs comprehensive tests. package model import ( "math" "testing" "github.com/unidoc/unipdf/v3/common" "github.com/unidoc/unipdf/v3/core" ) func init() { //common.SetLogger(common.ConsoleLogger{}) common.SetLogger(common.DummyLogger{}) } type Type4TestCase struct { Inputs []float64 Expected []float64 } // TODO: Implement example 2 from page 167. func TestType4Function1(t *testing.T) { rawText := ` 10 0 obj << /FunctionType 4 /Domain [ -1.0 1.0 -1.0 1.0] /Range [ -1.0 1.0 ] /Length 48 >> stream { 360 mul sin 2 div exch 360 mul sin 2 div add } endstream endobj ` /* * Inputs: [x y] where -1 0.000001 { t.Errorf("Failed, output and expected mismatch") return } } } t.Logf("%s", stream.Stream) }