From 9b5f6ae5f460c8642286cf174751a317f155d043 Mon Sep 17 00:00:00 2001 From: Dennis Vesterlund Date: Thu, 21 Feb 2019 15:34:32 +0100 Subject: Added function to print content from file (#331) Added a function to print file contents to status bar without newlines. Added tests for print file contents function Added manpage entry for file contents --- testcases/025-file-contents/expected_output.txt | 1 + testcases/025-file-contents/i3status.conf | 14 ++++++++++++++ testcases/025-file-contents/short.txt | 1 + 3 files changed, 16 insertions(+) create mode 100644 testcases/025-file-contents/expected_output.txt create mode 100644 testcases/025-file-contents/i3status.conf create mode 100644 testcases/025-file-contents/short.txt (limited to 'testcases') diff --git a/testcases/025-file-contents/expected_output.txt b/testcases/025-file-contents/expected_output.txt new file mode 100644 index 0000000..5c56020 --- /dev/null +++ b/testcases/025-file-contents/expected_output.txt @@ -0,0 +1 @@ +contents | NONEXISTANT - 2: No such file or directory diff --git a/testcases/025-file-contents/i3status.conf b/testcases/025-file-contents/i3status.conf new file mode 100644 index 0000000..26646cd --- /dev/null +++ b/testcases/025-file-contents/i3status.conf @@ -0,0 +1,14 @@ +general { + output_format = "none" +} + +order += "read_file EXISTING" +order += "read_file NONEXISTANT" + +read_file EXISTING { + path = "testcases/025-file-contents/short.txt" +} + +read_file NONEXISTANT { + path = "testcases/025-file-contents/nonexistant" +} diff --git a/testcases/025-file-contents/short.txt b/testcases/025-file-contents/short.txt new file mode 100644 index 0000000..12f00e9 --- /dev/null +++ b/testcases/025-file-contents/short.txt @@ -0,0 +1 @@ +contents -- cgit v1.2.3