Roxen.git / server / etc / test / tests / http / WebdavTestBase.pike

version» Context lines:

Roxen.git/server/etc/test/tests/http/WebdavTestBase.pike:17:   // Common HTTP headers to send for all HTTP requests.   private mapping(string:string) base_headers;      /* Some globals to avoid having to pass this stuff around explicitly. */   protected mapping(string:string) current_locks;      int filesystem_check_exists(string path);      string filesystem_read_file(string path);    - int filesystem_check_content(string path, string data) + int filesystem_check_content(string path, string expected_data)   { -  return filesystem_read_file(path) == data; +  string actual_data = filesystem_read_file(path); +  TEST_EQUAL(actual_data, expected_data); +  return actual_data == expected_data;   }      int filesystem_compare_files(string first_path, string other_path)   {    return filesystem_check_content(other_path, filesystem_read_file(first_path));   }         array(int|mapping(string:string)|string) webdav_request(string method,    string path,
Roxen.git/server/etc/test/tests/http/WebdavTestBase.pike:188:    string expected_content = filesystem_read_file(src_path);       array(int|mapping(string:string)|string) res =    webdav_request("MOVE", src_path, ([    "new-uri": dst_path,    ]));       if (!((res[0] >= 200) && (res[0] < 300))) return 0;       low_recursive_unlock(src_path, locks); -  +  test_false(filesystem_check_exists, src_path); +  test_true(filesystem_check_exists, dst_path); +  test_true(filesystem_check_content, dst_path, expected_content);    return    !filesystem_check_exists(src_path) &&    filesystem_check_content(dst_path, expected_content);   }      int webdav_mkcol(string path)   {    array(int|mapping(string:string)|string) res =    webdav_request("MKCOL", path);