about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-toString.nix
blob: eb8011158fd0ded7ed2aaecf8b0822fbce7e72d9 (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
24
25
26
27
28
let
  toStringableSet = {
    __toString = self: self.content;
    content = "Hello World";
  };

  toStringExamples = [
    null
    [ null false ]
    [ null /deep/thought ]
    [ [ null 2 ] null 3 ]
    [ false "flat" ]
    1
    4.2
    null
    false
    true
    "foo"
    /etc
    toStringableSet
    { __toString = _: toStringableSet; }
    { __toString = _: true; }
    { outPath = "out"; }
    { outPath = { outPath = { __toString = _: 2; }; }; }
  ];
in

(builtins.map toString toStringExamples) ++ [ (toString toStringExamples) ]