the create- tests are leaving dirs which should have been deleted
Closed this issue · 6 comments
@ylebre these should get deleted by https://github.com/solid/solid-crud-tests/blob/master/test/surface/create-container.test.ts#L53 and https://github.com/solid/solid-crud-tests/blob/master/test/surface/create-non-container.test.ts#L50.
Are you seeing DELETE requests getting sent to the servers at all? maybe it's not correctly interpreting your directory listings in https://github.com/solid/solid-crud-tests/blob/master/test/helpers/util.ts#L26 ?
Yep, the problem does lie with the directory listings. The code I'm bumping into is this (in helpers/util.ts):
function isContainer(url) {
return (url.substr(-1) === '/');
}
My directory listing is returning
contains <exists.ttl> <new>
notice that 'new' does not have a trailing slash. In the definition of further in the turtle document, it is specified as a BasicContainer and Container.
If I add a trailing slash after 'new', the recursive delete works as expected, but I'm not convinced that we should require a slash for that. Thoughts?
hm, interesting thought! Would it be much work to add that slash?
Certainly not - adding the slash is trivial, but shouldn't the test recurse into all the resources that are a Container instead of just the resources that end with a slash?
Good question. It hadn't occurred to me to leave out the trailing slash. I know some people who could discuss for days about the meaning of slashes in URLs :)
The spec does say that [p]aths ending with a slash
denote a container resource.
Ok, fixes this on the other side by adding a trailing slash to the directory path. no change needed here, the dirs are now correctly removed.