tests: initial integration tests
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I09ed2eea568edfaecdb800197bc36c416a6a6964
This commit is contained in:
parent
347175bb86
commit
8bce6c27b5
6 changed files with 148 additions and 0 deletions
39
tests/integration/regression_normal_nix.nix
Normal file
39
tests/integration/regression_normal_nix.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# Test that normal Nix evaluation is not broken
|
||||
# This file should work identically with or without the plugin
|
||||
let
|
||||
# Basic arithmetic
|
||||
math = 1 + 2 * 3;
|
||||
|
||||
# String operations
|
||||
str = "hello" + " " + "world";
|
||||
|
||||
# List operations
|
||||
list = [1 2 3] ++ [4 5 6];
|
||||
|
||||
# Attrset operations
|
||||
attrs =
|
||||
{
|
||||
a = 1;
|
||||
b = 2;
|
||||
}
|
||||
// {c = 3;};
|
||||
|
||||
# Functions
|
||||
double = x: x * 2;
|
||||
result = double 21;
|
||||
|
||||
# Conditionals
|
||||
cond =
|
||||
if true
|
||||
then "yes"
|
||||
else "no";
|
||||
|
||||
# Let bindings
|
||||
nested = let
|
||||
x = 10;
|
||||
y = 20;
|
||||
in
|
||||
x + y;
|
||||
in {
|
||||
inherit math str list attrs result cond nested;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue