about summary refs log blame commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-toString.nix
blob: e4dc18ac96a73fa57d5f71125d06e1ce802308d8 (plain) (tree)






















                                                                   
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) ]