2
* Copyright (c) 2017 elementary LLC
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public
6
* License as published by the Free Software Foundation, Inc.,; either
7
* version 3 of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* General Public License for more details.
14
* You should have received a copy of the GNU General Public
15
* License along with this program; if not, write to the
16
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
* Authored by: Jeremy Wootten <jeremy@elementaryos.org>
23
void add_file_utils_tests () {
25
Test.add_func ("/FileUtils/sanitize_null_abs_path", () => {
26
assert (PF.FileUtils.sanitize_path (null, null) == "");
29
Test.add_func ("/FileUtils/sanitize_zero_length_abs_path", () => {
30
assert (PF.FileUtils.sanitize_path ("", null) == "");
34
Test.add_func ("/FileUtils/sanitize_null_rel_path", () => {
35
string cp = "file://home";
36
assert (PF.FileUtils.sanitize_path (null, cp) == cp);
39
/* Get file for path */
40
Test.add_func ("/FileUtils/file_for_null_path", () => {
41
/* For some reason using assert_null does not work */
42
assert (PF.FileUtils.get_file_for_path (null) == null);
45
Test.add_func ("/FileUtils/file_for_zero_length_path", () => {
46
assert (PF.FileUtils.get_file_for_path ("") == null);
50
int main (string[] args) {
53
add_file_utils_tests ();