Skip to content

Commit

Permalink
tests: Check correct spacing and escape handling in strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jtojnar committed May 19, 2024
1 parent d41e83f commit a7296db
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/data/bytestring.settings
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ more'
nix-dollar=b"$"
no-unicode=b"\u202F"
octal=b'\7777\1\28\33\449\555\8\42\176\177'
spaces=b' foo\n bar '
5 changes: 5 additions & 0 deletions test/data/strings.settings
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
[strings]
escapes-double="\\\a\b\f\n\r\t\v\c\d\e\"'\'"
escapes-single='\\\a\b\f\n\r\t\v\c\d\e\""\''
spaces=" foo\n bar "

[org/gnome/evince]
document-directory="@ms 'file:///home/user/Downloads'"

Expand Down
1 change: 1 addition & 0 deletions test/output/bytestring.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ with lib.hm.gvariant;
nix-dollar = mkByteString ''${"$"}'';
no-unicode = mkByteString ''u202F'';
octal = mkByteString ''\3777\1\28\33${"$"}9m8"~\177'';
spaces = mkByteString '' foo\n bar '';
};

};
Expand Down
6 changes: 6 additions & 0 deletions test/output/strings.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ with lib.hm.gvariant;

{
dconf.settings = {
"strings" = {
escapes-double = "\\ \n cde\"''";
escapes-single = "\\ \n cde\"\"'";
spaces = " foo\n bar ";
};

"org/gnome/evince" = {
document-directory = "@ms 'file:///home/user/Downloads'";
};
Expand Down

0 comments on commit a7296db

Please sign in to comment.