]>
git.saurik.com Git - apt.git/blob - test/libapt/strutil_test.cc
1 #include <apt-pkg/strutl.h>
5 int main(int argc
,char *argv
[])
7 string input
, output
, expected
;
12 output
= DeEscapeString(input
);
13 equals(output
, expected
);
16 input
= "foo\\040bar\\x0abaz";
17 expected
= "foo bar\nbaz";
18 output
= DeEscapeString(input
);
19 equals(output
, expected
);
24 output
= DeEscapeString(input
);
25 equals(output
, expected
);
30 output
= DeEscapeString(input
);
31 equals(output
, expected
);
33 // double escape at the end
34 input
= "\\\\foo\\\\";
36 output
= DeEscapeString(input
);
37 equals(output
, expected
);
39 // the string that we actually need it for
40 input
= "/media/Ubuntu\\04011.04\\040amd64";
41 expected
= "/media/Ubuntu 11.04 amd64";
42 output
= DeEscapeString(input
);
43 equals(output
, expected
);