blob: 0ffe8101e9d862cbf503becb362e28e4bbdf6cac [file] [log] [blame]
Ian Lance Taylor6694f142012-11-08 09:04:27 -08001// run arg1 arg2
Russ Coxcd22afa2012-09-23 13:16:14 -04002
Rob Pike2987c842008-06-24 15:31:03 -07003// Copyright 2009 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
Rob Pikefc0dc042012-02-19 13:19:43 +11007// Test os.Args.
8
Rob Pike2987c842008-06-24 15:31:03 -07009package main
10
Russ Cox918afd942009-05-08 15:21:41 -070011import "os"
12
Rob Pike2987c842008-06-24 15:31:03 -070013func main() {
Russ Cox918afd942009-05-08 15:21:41 -070014 if len(os.Args) != 3 {
Rob Pikebc2f5f12008-08-11 22:07:49 -070015 panic("argc")
Rob Pike2987c842008-06-24 15:31:03 -070016 }
Russ Cox918afd942009-05-08 15:21:41 -070017 if os.Args[1] != "arg1" {
Rob Pikebc2f5f12008-08-11 22:07:49 -070018 panic("arg1")
Rob Pike2987c842008-06-24 15:31:03 -070019 }
Russ Cox918afd942009-05-08 15:21:41 -070020 if os.Args[2] != "arg2" {
Rob Pikebc2f5f12008-08-11 22:07:49 -070021 panic("arg2")
Rob Pike2987c842008-06-24 15:31:03 -070022 }
23}