From f23dcdd60330c3b2f83b5b4278e38c245c397468 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 13 Jan 2007 16:17:07 +0000 Subject: * Canonicalise ASTs in `nix-instantiate --eval': remove position info, sort attribute sets. --- tests/lang/parse-okay-1.exp | 2 +- tests/lang/parse-okay-crlf.exp | 2 +- tests/lang/parse-okay-regression-20041027.exp | 2 +- tests/lang/parse-okay-subversion.exp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/lang/parse-okay-1.exp b/tests/lang/parse-okay-1.exp index 6647578593a9..1e4378fed75b 100644 --- a/tests/lang/parse-okay-1.exp +++ b/tests/lang/parse-okay-1.exp @@ -1 +1 @@ -Function([Formal("x",UnrestrictedValues,NoDefaultValue),Formal("y",UnrestrictedValues,NoDefaultValue),Formal("z",UnrestrictedValues,NoDefaultValue)],OpPlus(OpPlus(Var("x"),Var("y")),Var("z")),Pos("(string)",1,2)) +Function([Formal("x",UnrestrictedValues,NoDefaultValue),Formal("y",UnrestrictedValues,NoDefaultValue),Formal("z",UnrestrictedValues,NoDefaultValue)],OpPlus(OpPlus(Var("x"),Var("y")),Var("z")),NoPos) diff --git a/tests/lang/parse-okay-crlf.exp b/tests/lang/parse-okay-crlf.exp index f378433a441b..7d4d9e3876c2 100644 --- a/tests/lang/parse-okay-crlf.exp +++ b/tests/lang/parse-okay-crlf.exp @@ -1 +1 @@ -Rec([Bind("x",Var("y"),Pos("(string)",6,4)),Bind("y",Int(123),Pos("(string)",10,4)),Bind("foo",Str("multi\nline\n string\n test\r",[]),Pos("(string)",14,6)),Bind("z",Int(456),Pos("(string)",19,4))],[]) +Rec([Bind("x",Var("y"),NoPos),Bind("y",Int(123),NoPos),Bind("foo",Str("multi\nline\n string\n test\r",[]),NoPos),Bind("z",Int(456),NoPos)],[]) diff --git a/tests/lang/parse-okay-regression-20041027.exp b/tests/lang/parse-okay-regression-20041027.exp index d46d3b71ae8b..246779fa5400 100644 --- a/tests/lang/parse-okay-regression-20041027.exp +++ b/tests/lang/parse-okay-regression-20041027.exp @@ -1 +1 @@ -Function([Formal("stdenv",UnrestrictedValues,NoDefaultValue),Formal("fetchurl",UnrestrictedValues,NoDefaultValue)],Call(Select(Var("stdenv"),"mkDerivation"),Attrs([Bind("name",Str("libXi-6.0.1",[]),Pos("(string)",4,7)),Bind("src",Call(Var("fetchurl"),Attrs([Bind("url",Str("http://freedesktop.org/~xlibs/release/libXi-6.0.1.tar.bz2",[]),Pos("(string)",6,8)),Bind("md5",Str("7e935a42428d63a387b3c048be0f2756",[]),Pos("(string)",7,8))])),Pos("(string)",5,6))])),Pos("(string)",1,2)) +Function([Formal("stdenv",UnrestrictedValues,NoDefaultValue),Formal("fetchurl",UnrestrictedValues,NoDefaultValue)],Call(Select(Var("stdenv"),"mkDerivation"),Attrs([Bind("name",Str("libXi-6.0.1",[]),NoPos),Bind("src",Call(Var("fetchurl"),Attrs([Bind("md5",Str("7e935a42428d63a387b3c048be0f2756",[]),NoPos),Bind("url",Str("http://freedesktop.org/~xlibs/release/libXi-6.0.1.tar.bz2",[]),NoPos)])),NoPos)])),NoPos) diff --git a/tests/lang/parse-okay-subversion.exp b/tests/lang/parse-okay-subversion.exp index eb0398303cfe..0ea2a88edcbe 100644 --- a/tests/lang/parse-okay-subversion.exp +++ b/tests/lang/parse-okay-subversion.exp @@ -1 +1 @@ -Function([Formal("localServer",UnrestrictedValues,DefaultValue(Var("false"))),Formal("httpServer",UnrestrictedValues,DefaultValue(Var("false"))),Formal("sslSupport",UnrestrictedValues,DefaultValue(Var("false"))),Formal("pythonBindings",UnrestrictedValues,DefaultValue(Var("false"))),Formal("javaSwigBindings",UnrestrictedValues,DefaultValue(Var("false"))),Formal("javahlBindings",UnrestrictedValues,DefaultValue(Var("false"))),Formal("stdenv",UnrestrictedValues,NoDefaultValue),Formal("fetchurl",UnrestrictedValues,NoDefaultValue),Formal("openssl",UnrestrictedValues,DefaultValue(Var("null"))),Formal("httpd",UnrestrictedValues,DefaultValue(Var("null"))),Formal("db4",UnrestrictedValues,DefaultValue(Var("null"))),Formal("expat",UnrestrictedValues,NoDefaultValue),Formal("swig",UnrestrictedValues,DefaultValue(Var("null"))),Formal("j2sdk",UnrestrictedValues,DefaultValue(Var("null")))],Assert(OpNEq(Var("expat"),Var("null")),Assert(OpImpl(Var("localServer"),OpNEq(Var("db4"),Var("null"))),Assert(OpImpl(Var("httpServer"),OpAnd(OpNEq(Var("httpd"),Var("null")),OpEq(Select(Var("httpd"),"expat"),Var("expat")))),Assert(OpImpl(Var("sslSupport"),OpAnd(OpNEq(Var("openssl"),Var("null")),OpImpl(Var("httpServer"),OpEq(Select(Var("httpd"),"openssl"),Var("openssl"))))),Assert(OpImpl(Var("pythonBindings"),OpAnd(OpNEq(Var("swig"),Var("null")),Select(Var("swig"),"pythonSupport"))),Assert(OpImpl(Var("javaSwigBindings"),OpAnd(OpNEq(Var("swig"),Var("null")),Select(Var("swig"),"javaSupport"))),Assert(OpImpl(Var("javahlBindings"),OpNEq(Var("j2sdk"),Var("null"))),Call(Select(Var("stdenv"),"mkDerivation"),Attrs([Bind("name",Str("subversion-1.1.1",[]),Pos("(string)",20,7)),Bind("builder",Path("/foo/bar"),Pos("(string)",22,10)),Bind("src",Call(Var("fetchurl"),Attrs([Bind("url",Str("http://subversion.tigris.org/tarballs/subversion-1.1.1.tar.bz2",[]),Pos("(string)",24,8)),Bind("md5",Str("a180c3fe91680389c210c99def54d9e0",[]),Pos("(string)",25,8))])),Pos("(string)",23,6)),Bind("patches",If(Var("javahlBindings"),List([Path("/javahl.patch")]),List([])),Pos("(string)",31,10)),Bind("openssl",If(Var("sslSupport"),Var("openssl"),Var("null")),Pos("(string)",33,10)),Bind("httpd",If(Var("httpServer"),Var("httpd"),Var("null")),Pos("(string)",34,8)),Bind("db4",If(Var("localServer"),Var("db4"),Var("null")),Pos("(string)",35,6)),Bind("swig",If(OpOr(Var("pythonBindings"),Var("javaSwigBindings")),Var("swig"),Var("null")),Pos("(string)",36,7)),Bind("python",If(Var("pythonBindings"),Select(Var("swig"),"python"),Var("null")),Pos("(string)",37,9)),Bind("j2sdk",If(Var("javaSwigBindings"),Select(Var("swig"),"j2sdk"),If(Var("javahlBindings"),Var("j2sdk"),Var("null"))),Pos("(string)",38,8)),Bind("expat",Var("expat"),Pos("(string)",41,10)),Bind("localServer",Var("localServer"),Pos("(string)",41,10)),Bind("httpServer",Var("httpServer"),Pos("(string)",41,10)),Bind("sslSupport",Var("sslSupport"),Pos("(string)",41,10)),Bind("pythonBindings",Var("pythonBindings"),Pos("(string)",41,10)),Bind("javaSwigBindings",Var("javaSwigBindings"),Pos("(string)",41,10)),Bind("javahlBindings",Var("javahlBindings"),Pos("(string)",41,10))])),Pos("(string)",17,7)),Pos("(string)",16,7)),Pos("(string)",15,7)),Pos("(string)",14,7)),Pos("(string)",13,7)),Pos("(string)",12,7)),Pos("(string)",11,7)),Pos("(string)",1,2)) +Function([Formal("localServer",UnrestrictedValues,DefaultValue(Var("false"))),Formal("httpServer",UnrestrictedValues,DefaultValue(Var("false"))),Formal("sslSupport",UnrestrictedValues,DefaultValue(Var("false"))),Formal("pythonBindings",UnrestrictedValues,DefaultValue(Var("false"))),Formal("javaSwigBindings",UnrestrictedValues,DefaultValue(Var("false"))),Formal("javahlBindings",UnrestrictedValues,DefaultValue(Var("false"))),Formal("stdenv",UnrestrictedValues,NoDefaultValue),Formal("fetchurl",UnrestrictedValues,NoDefaultValue),Formal("openssl",UnrestrictedValues,DefaultValue(Var("null"))),Formal("httpd",UnrestrictedValues,DefaultValue(Var("null"))),Formal("db4",UnrestrictedValues,DefaultValue(Var("null"))),Formal("expat",UnrestrictedValues,NoDefaultValue),Formal("swig",UnrestrictedValues,DefaultValue(Var("null"))),Formal("j2sdk",UnrestrictedValues,DefaultValue(Var("null")))],Assert(OpNEq(Var("expat"),Var("null")),Assert(OpImpl(Var("localServer"),OpNEq(Var("db4"),Var("null"))),Assert(OpImpl(Var("httpServer"),OpAnd(OpNEq(Var("httpd"),Var("null")),OpEq(Select(Var("httpd"),"expat"),Var("expat")))),Assert(OpImpl(Var("sslSupport"),OpAnd(OpNEq(Var("openssl"),Var("null")),OpImpl(Var("httpServer"),OpEq(Select(Var("httpd"),"openssl"),Var("openssl"))))),Assert(OpImpl(Var("pythonBindings"),OpAnd(OpNEq(Var("swig"),Var("null")),Select(Var("swig"),"pythonSupport"))),Assert(OpImpl(Var("javaSwigBindings"),OpAnd(OpNEq(Var("swig"),Var("null")),Select(Var("swig"),"javaSupport"))),Assert(OpImpl(Var("javahlBindings"),OpNEq(Var("j2sdk"),Var("null"))),Call(Select(Var("stdenv"),"mkDerivation"),Attrs([Bind("builder",Path("/foo/bar"),NoPos),Bind("db4",If(Var("localServer"),Var("db4"),Var("null")),NoPos),Bind("expat",Var("expat"),NoPos),Bind("httpServer",Var("httpServer"),NoPos),Bind("httpd",If(Var("httpServer"),Var("httpd"),Var("null")),NoPos),Bind("j2sdk",If(Var("javaSwigBindings"),Select(Var("swig"),"j2sdk"),If(Var("javahlBindings"),Var("j2sdk"),Var("null"))),NoPos),Bind("javaSwigBindings",Var("javaSwigBindings"),NoPos),Bind("javahlBindings",Var("javahlBindings"),NoPos),Bind("localServer",Var("localServer"),NoPos),Bind("name",Str("subversion-1.1.1",[]),NoPos),Bind("openssl",If(Var("sslSupport"),Var("openssl"),Var("null")),NoPos),Bind("patches",If(Var("javahlBindings"),List([Path("/javahl.patch")]),List([])),NoPos),Bind("python",If(Var("pythonBindings"),Select(Var("swig"),"python"),Var("null")),NoPos),Bind("pythonBindings",Var("pythonBindings"),NoPos),Bind("src",Call(Var("fetchurl"),Attrs([Bind("md5",Str("a180c3fe91680389c210c99def54d9e0",[]),NoPos),Bind("url",Str("http://subversion.tigris.org/tarballs/subversion-1.1.1.tar.bz2",[]),NoPos)])),NoPos),Bind("sslSupport",Var("sslSupport"),NoPos),Bind("swig",If(OpOr(Var("pythonBindings"),Var("javaSwigBindings")),Var("swig"),Var("null")),NoPos)])),NoPos),NoPos),NoPos),NoPos),NoPos),NoPos),NoPos),NoPos) -- cgit 1.4.1