about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-toString.nix
blob: e4dc18ac96a73fa57d5f71125d06e1ce802308d8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
let
  toStringableSet = {
    __toString = self: self.content;
    content = "Hello World";
  };

  toStringExamples = [
    (toString 1)
    (toString 4.2)
    (toString null)
    (toString false)
    (toString true)
    (toString "foo")
    (toString /etc)
    (toString toStringableSet)
    (toString { __toString = _: toStringableSet; })
    (toString { __toString = _: true; })
    (toString { outPath = "out"; })
    (toString { outPath = { outPath = { __toString = _: 2; }; }; })
  ];
in

toStringExamples ++ [ (toString toStringExamples) ]