aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/libexpr/flakeref.cc
blob: 2b7809b938d3635fed7a610622af2aa2823073f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
    }

}