Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@JeremyKuhne
Copy link
Member

Updates for dotnet/coreclr#16478

Tagged these tests with #27269 as they're related. Will update for both PRs from CoreCLR.

cc: @danmosemsft

Assert.ThrowsAny<IOException>(() =>
{
var catalog = catalogCreator("??||>");
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: doesn't need to store the result:

Assert.ThrowsAny<IOException>(() => catalogCreator("??||>"));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was following along with the rest of the file's style. I'll go ahead and change all of them.

public void PathWithInvalidCharactersAsPath_Core(string invalidPath)
{
if (invalidPath.Contains('\0'))
Assert.Throws<ArgumentException>(() => Create(invalidPath));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a param name we can include/test here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for desktop, but now that I've split it up I can (and will) add it for core.

Assert.Throws<NotSupportedException>(() => Create(invalidPath));
if (PathFeatures.IsUsingLegacyPathNormalization())
{
Assert.Throws<ArgumentException>(() => Create(invalidPath));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question for all of these arg exceptions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For desktop the answer is no for ArgumentException. IOException doesn't have a parameter and I'm not sure we could add one in a way that made sense.

Copy link

@maryamariyan maryamariyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @JeremyKuhne

public void WindowsControlWhiteSpace_Core(string component)
{
// CreateSubdirectory will throw when passed a path with control whitespace e.g. "\t"
string path = IOServices.RemoveTrailingSlash(GetTestFileName());
Copy link

@maryamariyan maryamariyan Feb 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering why we had this path statement here in the existing test you copied from when it's not going to throw exception? the input argument is component which is being used in the next statement not to compute path.
Am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just missed the fact that it wasn't used as I plowed through these. Good catch.

@JeremyKuhne JeremyKuhne merged commit 92afa6e into dotnet:master Feb 22, 2018
@JeremyKuhne JeremyKuhne deleted the pathtest2 branch February 22, 2018 20:13
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Update tests for Path changes

Updates for dotnet/coreclr#16478

* Add back Unix active issue (wishful thinking that this would get the same error on Unix)

* Address feedback


Commit migrated from dotnet/corefx@92afa6e
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants