-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Patrick Widmer
committed
Nov 13, 2023
1 parent
691cbcc
commit 91f508a
Showing
15 changed files
with
274 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
{ generators-tokdl = ./tokdl.nix; } | ||
{ | ||
generators-tokdl = ./tokdl.nix; | ||
generators-toscfg-empty = ./toscfg-empty.nix; | ||
generators-toscfg-example = ./toscfg-example.nix; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ config, lib, ... }: | ||
|
||
{ | ||
home.file."toscfg-empty-result.txt".text = lib.hm.generators.toSCFG { } { }; | ||
|
||
nmt.script = '' | ||
assertFileContent \ | ||
home-files/toscfg-empty-result.txt \ | ||
${./toscfg-empty-result.txt} | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ config, lib, ... }: | ||
|
||
{ | ||
home.file."toscfg-err-dir-empty-name-result.txt".text = | ||
lib.hm.generators.toSCFG { } { "" = [ ]; }; | ||
|
||
nmt.script = '' | ||
assertFileContent \ | ||
home-files/toscfg-err-dir-empty-name-result.txt \ | ||
${./toscfg-err-dir-empty-name-result.txt} | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
dir { | ||
blk1 p1 "\"p2\"" { | ||
sub1 arg11 arg12 | ||
sub2 arg21 arg22 | ||
sub3 arg31 arg32 { | ||
sub-sub1 | ||
sub-sub2 arg321 arg322 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ config, lib, ... }: | ||
|
||
{ | ||
home.file."toscfg-example-result.txt".text = lib.hm.generators.toSCFG { } { | ||
dir = { | ||
blk1 = { | ||
_params = [ "p1" ''"p2"'' ]; | ||
sub1 = [ "arg11" "arg12" ]; | ||
sub2 = [ "arg21" "arg22" ]; | ||
sub3 = { | ||
_params = [ "arg31" "arg32" ]; | ||
sub-sub1 = [ ]; | ||
sub-sub2 = [ "arg321" "arg322" ]; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
nmt.script = '' | ||
assertFileContent \ | ||
home-files/toscfg-example-result.txt \ | ||
${./toscfg-example-result.txt} | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
senpai-example-settings = ./example-settings.nix; | ||
senpai-empty-settings = ./empty-settings.nix; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
address irc.libera.chat | ||
nickname Guest123456 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ config, ... }: | ||
|
||
{ | ||
config = { | ||
programs.senpai = { | ||
enable = true; | ||
package = config.lib.test.mkStubPackage { }; | ||
config = { | ||
address = "irc.libera.chat"; | ||
nickname = "Guest123456"; | ||
}; | ||
}; | ||
|
||
nmt.script = '' | ||
assertFileContent \ | ||
home-files/.config/senpai/senpai.scfg \ | ||
${./empty-settings-expected.conf} | ||
''; | ||
}; | ||
} |
13 changes: 13 additions & 0 deletions
13
tests/modules/programs/senpai/example-settings-expected.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
address irc.libera.chat | ||
channel #rahxephon | ||
colors { | ||
prompt 2 | ||
} | ||
highlight guest senpai lenon | ||
nickname Guest123456 | ||
pane-widths { | ||
nicknames 16 | ||
} | ||
password-cmd gopass show irc/guest | ||
realname "Guest von Lenon" | ||
username senpai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ config, ... }: | ||
|
||
{ | ||
config = { | ||
programs.senpai = { | ||
enable = true; | ||
package = config.lib.test.mkStubPackage { }; | ||
config = { | ||
address = "irc.libera.chat"; | ||
nickname = "Guest123456"; | ||
password-cmd = [ "gopass" "show" "irc/guest" ]; | ||
username = "senpai"; | ||
realname = "Guest von Lenon"; | ||
channel = [ "#rahxephon" ]; | ||
highlight = [ "guest" "senpai" "lenon" ]; | ||
pane-widths = { nicknames = 16; }; | ||
colors = { prompt = 2; }; | ||
}; | ||
}; | ||
|
||
nmt.script = '' | ||
assertFileContent \ | ||
home-files/.config/senpai/senpai.scfg \ | ||
${./example-settings-expected.conf} | ||
''; | ||
}; | ||
} |