Implemented copy constructor for Skylark dictionaries: new_dict = dict(old_dict)

--
MOS_MIGRATED_REVID=103932279
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java b/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java
index 72fd205..de92681 100644
--- a/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java
+++ b/src/test/java/com/google/devtools/build/lib/syntax/MethodLibraryTest.java
@@ -123,8 +123,8 @@
             + "but should be string",
             "'test'.startswith(1)")
         .testIfErrorContains(
-            "Method dict(args: Iterable, **kwargs) is not applicable for arguments "
-            + "(string, dict): 'args' is string, but should be Iterable",
+            "expected value of type 'list(object)' for parameter args in dict(), "
+            + "but got \"a\" (string)",
             "dict('a')");
   }
 
@@ -647,6 +647,20 @@
   }
 
   @Test
+  public void testDictionaryCopy() throws Exception {
+    new SkylarkTest()
+        .setUp("x = {1 : 2}", "y = dict(x)")
+        .testEval("x[1] == 2 and y[1] == 2", "True");
+  }
+
+  @Test
+  public void testDictionaryCopyKeyCollision() throws Exception {
+    new SkylarkTest()
+        .setUp("x = {'test' : 2}", "y = dict(x, test = 3)")
+        .testEval("y['test']", "3");
+  }
+
+  @Test
   public void testDictionaryWithMultipleKeys() throws Exception {
     new BothModesTest().testStatement("{0: 'a', 1: 'b', 0: 'c'}[0]", "c");
   }
@@ -741,19 +755,18 @@
 
   @Test
   public void testDictionaryCreationInvalidPositional() throws Exception {
-    String unexpectedString =
-        "expected value of type 'list(object)' for dict(args), but got \"a\" (string)";
-
     new BothModesTest()
         .testIfErrorContains(
-            "Method dict(args: Iterable, **kwargs) is not applicable for arguments "
-            + "(string, dict): 'args' is string, but should be Iterable",
+            "expected value of type 'list(object)' for parameter args in dict(), "
+            + "but got \"a\" (string)",
             "dict('a')")
-        .testIfErrorContains(unexpectedString, "dict(['a'])")
-        .testIfErrorContains(unexpectedString, "dict([('a')])")
+        .testIfErrorContains(
+            "Cannot convert dictionary update sequence element #0 to a sequence", "dict(['a'])")
+        .testIfErrorContains(
+            "Cannot convert dictionary update sequence element #0 to a sequence", "dict([('a')])")
         .testIfErrorContains("too many (3) positional arguments", "dict((3,4), (3,2), (1,2))")
         .testIfErrorContains(
-            "Tuple has length 3, but exactly two elements are required",
+            "Sequence #0 has length 3, but exactly two elements are required",
             "dict([('a', 'b', 'c')])");
   }