From c5d8fab058ee5a9b069b17399a1ef93ce3ca8e0e Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Tue, 17 Apr 2018 09:29:54 -0400 Subject: Docx reader tests: Test for combining adjacent code blocks. --- test/Tests/Readers/Docx.hs | 4 ++++ test/docx/adjacent_codeblocks.docx | Bin 0 -> 22437 bytes test/docx/adjacent_codeblocks.native | 6 ++++++ 3 files changed, 10 insertions(+) create mode 100644 test/docx/adjacent_codeblocks.docx create mode 100644 test/docx/adjacent_codeblocks.native diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs index 4f2ad524a..a02e1f35a 100644 --- a/test/Tests/Readers/Docx.hs +++ b/test/Tests/Readers/Docx.hs @@ -290,6 +290,10 @@ tests = [ testGroup "inlines" "code block" "docx/codeblock.docx" "docx/codeblock.native" + , testCompare + "combine adjacent code blocks" + "docx/adjacent_codeblocks.docx" + "docx/adjacent_codeblocks.native" , testCompare "dropcap paragraphs" "docx/drop_cap.docx" diff --git a/test/docx/adjacent_codeblocks.docx b/test/docx/adjacent_codeblocks.docx new file mode 100644 index 000000000..d61fb45d5 Binary files /dev/null and b/test/docx/adjacent_codeblocks.docx differ diff --git a/test/docx/adjacent_codeblocks.native b/test/docx/adjacent_codeblocks.native new file mode 100644 index 000000000..ec1e2416e --- /dev/null +++ b/test/docx/adjacent_codeblocks.native @@ -0,0 +1,6 @@ +[Para [Str "Next,",Space,Str "open",Space,Str "the",Space,Str "terminal",Space,Str "window.",Space,Str "Using",Space,Str "the",Space,Str "terminal",Space,Str "window,",Space,Str "run",Space,Str "the",Space,Str "\"ifconfig",Space,Str "-a\"",Space,Str "command",Space,Str "to",Space,Str "list",Space,Str "all",Space,Str "the",Space,Str "interfaces",Space,Str "on",Space,Str "your",Space,Str "system,",Space,Str "as",Space,Str "shown",Space,Str "here."] +,CodeBlock ("",[],[]) "# ifconfig -a\neth0 Link encap:Ethernet HWaddr 00:0c:29:69:12:7c \n inet addr:172.16.0.108 Bcast:172.16.0.255 Mask:255.255.255.0\n inet6 addr: fc00:660:0:1:20c:29ff:fe69:127c/64 Scope:Global\n inet6 addr: fe80::20c:29ff:fe69:127c/64 Scope:Link\n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:9859 errors:0 dropped:0 overruns:0 frame:0\n TX packets:1399 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:1920894 (1.8 MiB) TX bytes:233088 (227.6 KiB)\n Interrupt:19 Base address:0x2000 \n\nlo Link encap:Local Loopback \n inet addr:127.0.0.1 Mask:255.0.0.0\n inet6 addr: ::1/128 Scope:Host\n UP LOOPBACK RUNNING MTU:65536 Metric:1\n RX packets:372 errors:0 dropped:0 overruns:0 frame:0\n TX packets:372 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:0 \n RX bytes:22320 (21.7 KiB) TX bytes:22320 (21.7 KiB)\n\nwlan0 Link encap:Ethernet HWaddr 00:c0:ca:85:00:ba \n UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1\n RX packets:0 errors:0 dropped:0 overruns:0 frame:0\n TX packets:0 errors:0 dropped:0 overruns:0 carrier:0\n collisions:0 txqueuelen:1000 \n RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)" +,Para [Str "The",Space,Str "ALFA",Space,Str "wireless",Space,Str "card",Space,Str "is",Space,Str "represented",Space,Str "by",Space,Str "the",Space,Str "\"wlan0\"",Space,Str "interface."] +,Para [Str "In",Space,Str "addition",Space,Str "to",Space,Str "the",Space,Str "interfaces",Space,Str "shown",Space,Str "in",Space,Str "the",Space,Str "ifconfig",Space,Str "output,",Space,Str "there",Space,Str "is",Space,Str "another",Space,Str "interface",Space,Str "known",Space,Str "as",Space,Str "the",Space,Emph [Str "wireless",Space,Str "physical",Space,Str "interface"],Str ".",Space,Str "We",Space,Str "can",Space,Str "identify",Space,Str "this",Space,Str "interface",Space,Str "by",Space,Str "listing",Space,Str "the",Space,Str "contents",Space,Str "of",Space,Str "the",Space,Str "/sys/class/ieee80211",Space,Str "directory,",Space,Str "as",Space,Str "shown."] +,CodeBlock ("",[],[]) "# ls /sys/class/ieee80211/\nphy0" +,Para [Str "The",Space,Str "\"phy0\"",Space,Str "interface",Space,Str "is",Space,Str "the",Space,Str "parent",Space,Str "interface",Space,Str "used",Space,Str "to",Space,Str "create",Space,Str "child",Space,Str "interfaces.",Space,Str "Note",Space,Str "that",Space,Str "if",Space,Str "you",Space,Str "unplug",Space,Str "and",Space,Str "replug",Space,Str "the",Space,Str "USB",Space,Str "interface,",Space,Str "the",Space,Str "\"phy\"",Space,Str "interface",Space,Str "number",Space,Str "will",Space,Str "increment",Space,Str "by",Space,Str "one",Space,Str "until",Space,Str "you",Space,Str "reboot",Space,Str "your",Space,Str "system."]] -- cgit v1.2.3