forked from lix-project/lix
libexpr/tests: test that parseFlakeRef doesn't percent-encode twice
This commit is contained in:
parent
db3bf180a5
commit
1d7a57cfd9
22
src/libexpr/tests/flakeref.cc
Normal file
22
src/libexpr/tests/flakeref.cc
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
|
#include "flake/flakeref.hh"
|
||||||
|
|
||||||
|
namespace nix {
|
||||||
|
|
||||||
|
/* ----------- tests for flake/flakeref.hh --------------------------------------------------*/
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------------------
|
||||||
|
* to_string
|
||||||
|
* --------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
TEST(to_string, doesntReencodeUrl) {
|
||||||
|
auto s = "http://localhost:8181/test/+3d.tar.gz";
|
||||||
|
auto flakeref = parseFlakeRef(s);
|
||||||
|
auto parsed = flakeref.to_string();
|
||||||
|
auto expected = "http://localhost:8181/test/%2B3d.tar.gz";
|
||||||
|
|
||||||
|
ASSERT_EQ(parsed, expected);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in a new issue