2023-08-17 20:40:57 +00:00
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
2024-11-12 23:07:17 +00:00
|
|
|
#include "lix/libexpr/flake/flakeref.hh"
|
2023-08-17 20:40:57 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|