mirror of
https://github.com/dart-lang/sdk
synced 2024-09-18 21:31:20 +00:00
d8ef2ae701
R=hausner@google.com Review URL: https://codereview.chromium.org//16783003 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@23886 260f80e4-7a28-3924-810f-c04153c831b5
25 lines
628 B
Dart
25 lines
628 B
Dart
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// Test to ensure that the VM does not have an integer overflow issue
|
|
// when concatenating strings.
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
main()
|
|
{
|
|
String a = "a";
|
|
for( ; a.length < 256 * 1024 * 1024 ; )
|
|
a = a + a;
|
|
|
|
var exception_thrown = false;
|
|
try {
|
|
var concat = "$a$a$a$a$a$a$a$a";
|
|
} on OutOfMemoryError catch (exc) {
|
|
exception_thrown = true;
|
|
}
|
|
Expect.isTrue(exception_thrown);
|
|
}
|
|
|