/*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2015 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
EXPECT_EQ("/etc/motd", u.path());
EXPECT_EQ("", u.query());
EXPECT_EQ("", u.fragment());
- EXPECT_EQ("file:///etc/motd", u.fbstr());
+ EXPECT_EQ("file:/etc/motd", u.fbstr());
}
{
// success
}
}
+
+ // No authority (no "//") is valid
+ {
+ fbstring s("this:is/a/valid/uri");
+ Uri u(s);
+ EXPECT_EQ("this", u.scheme());
+ EXPECT_EQ("is/a/valid/uri", u.path());
+ EXPECT_EQ(s, u.fbstr());
+ }
+ {
+ fbstring s("this:is:another:valid:uri");
+ Uri u(s);
+ EXPECT_EQ("this", u.scheme());
+ EXPECT_EQ("is:another:valid:uri", u.path());
+ EXPECT_EQ(s, u.fbstr());
+ }
+ {
+ fbstring s("this:is@another:valid:uri");
+ Uri u(s);
+ EXPECT_EQ("this", u.scheme());
+ EXPECT_EQ("is@another:valid:uri", u.path());
+ EXPECT_EQ(s, u.fbstr());
+ }
}
/**