]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/import5.go
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / test / import5.go
index acd03c9ce9f13a7c0520eea46903ca06c197dc6b..8fdc8c3757409f416156ac68a7f893ae712df836 100644 (file)
@@ -4,8 +4,24 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// import paths are slash-separated; reject backslash
+// Verify that invalid imports are rejected by the compiler.
+// Does not compile.
 
 package main
 
-import `net\http`  // ERROR "backslash"
+// Correct import paths.
+import _ "fmt"
+import _ `time`
+import _ "m\x61th"
+import _ "go/parser"
+
+// Correct import paths, but the packages don't exist.
+// Don't test.
+//import "a.b"
+//import "greek/αβ"
+
+// Import paths must be strings.
+import 42    // ERROR "import path must be a string"
+import 'a'   // ERROR "import path must be a string"
+import 3.14  // ERROR "import path must be a string"
+import 0.25i // ERROR "import path must be a string"