From 3409bb2919ac1949ce8f0692dc83eea0776c517a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=E1=BA=A9m=20Hu=E1=BB=B3nh?= Date: Tue, 2 Oct 2018 20:37:11 +0200 Subject: [PATCH] Use Adobe Illustrator as a sample file --- test/saxy_test.exs | 10 ++++++++-- test/support/fixture/illustrator.svg | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 test/support/fixture/illustrator.svg diff --git a/test/saxy_test.exs b/test/saxy_test.exs index 285c0a8..bf52527 100644 --- a/test/saxy_test.exs +++ b/test/saxy_test.exs @@ -19,6 +19,10 @@ defmodule SaxyTest do data = File.read!("./test/support/fixture/complex.xml") assert {:ok, state} = Saxy.parse_string(data, StackHandler, []) assert length(state) == 79 + + data = File.read!("./test/support/fixture/illustrator.svg") + assert {:ok, state} = Saxy.parse_string(data, StackHandler, []) + assert length(state) == 12 end test "parse_string/4 parses XML binary with multiple \":expand_entity\" strategy" do @@ -64,13 +68,15 @@ defmodule SaxyTest do stream = File.stream!("./test/support/fixture/food.xml", [], 200) assert {:ok, state} = Saxy.parse_stream(stream, StackHandler, []) - assert length(state) == 74 stream = File.stream!("./test/support/fixture/complex.xml", [], 200) assert {:ok, state} = Saxy.parse_stream(stream, StackHandler, []) - assert length(state) == 79 + + stream = File.stream!("./test/support/fixture/illustrator.svg", [], 5) + assert {:ok, state} = Saxy.parse_stream(stream, StackHandler, []) + assert length(state) == 12 end test "parse_stream/3 parses normal stream" do diff --git a/test/support/fixture/illustrator.svg b/test/support/fixture/illustrator.svg new file mode 100644 index 0000000..b2a37bd --- /dev/null +++ b/test/support/fixture/illustrator.svg @@ -0,0 +1,16 @@ + + + + + + + + + +