<commit_before>// RUN: %target-run-simple-swift | FileCheck %s
// REQUIRES: executable_test

// CHECK-NOT: Reallocations exceeded 30
func testReallocation() {
  var x = "The quick brown fox jumped over the lazy dog\n"._split(separator: " ")

  var story = "Let me tell you a story:"
  var laps = 1000

  var reallocations = 0
  for i in 0..<laps {
    for s in x {
      var lastBase = story._core._baseAddress
      story += " "
      story += s
      if lastBase != story._core._baseAddress {
        reallocations += 1
        
        // To avoid dumping a vast string here, just write the first
        // part of the story out each time there's a reallocation.
        var intro = story._split(":")[0]
        print("reallocation \(reallocations), with intro \(intro)")
        
        if reallocations >= 30 {
          print("Reallocations exceeded 30")
          return
        }
      }
    }
    story += "."
  }
  print("total reallocations = \(reallocations)")
}

testReallocation()
print("done!")<commit_msg>stdlib: Add missing separator label that escaped previous audit.<commit_after>// RUN: %target-run-simple-swift | FileCheck %s
// REQUIRES: executable_test

// CHECK-NOT: Reallocations exceeded 30
func testReallocation() {
  var x = "The quick brown fox jumped over the lazy dog\n"._split(separator: " ")

  var story = "Let me tell you a story:"
  var laps = 1000

  var reallocations = 0
  for i in 0..<laps {
    for s in x {
      var lastBase = story._core._baseAddress
      story += " "
      story += s
      if lastBase != story._core._baseAddress {
        reallocations += 1
        
        // To avoid dumping a vast string here, just write the first
        // part of the story out each time there's a reallocation.
        var intro = story._split(separator: ":")[0]
        print("reallocation \(reallocations), with intro \(intro)")
        
        if reallocations >= 30 {
          print("Reallocations exceeded 30")
          return
        }
      }
    }
    story += "."
  }
  print("total reallocations = \(reallocations)")
}

testReallocation()
print("done!")
{'fraction_non_alphanumeric': 0.11337760910815939, 'fraction_numerical': 0.013282732447817837, 'mean_word_length': 2.3108320251177394, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4924310', 'n_tokens_mistral': 677, 'n_tokens_neox': 618, 'n_words': 206}