<commit_before>// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Note that while this file is in testing/ and tests GTest macros, it is built
// as part of Chromium's unit_tests target because the project does not build
// or run GTest's internal test suite.

#import "testing/gtest_mac.h"

#import <Foundation/Foundation.h>

#include "base/mac/scoped_nsautorelease_pool.h"
#include "testing/gtest/include/gtest/internal/gtest-port.h"
#include "testing/gtest/include/gtest/gtest.h"

TEST(GTestMac, ExpectNSEQ) {
  base::mac::ScopedNSAutoreleasePool pool;

  EXPECT_NSEQ(@"a", @"a");

  NSString* s1 = [NSString stringWithUTF8String:"a"];
  NSString* s2 = [NSString stringWithString:@"a"];
  EXPECT_NE(s1, s2);
  EXPECT_NSEQ(s1, s2);
}

TEST(GTestMac, AssertNSEQ) {
  base::mac::ScopedNSAutoreleasePool pool;

  NSNumber* n1 = [NSNumber numberWithInt:42];
  NSNumber* n2 = [NSNumber numberWithInt:42];
  EXPECT_NE(n1, n2);
  ASSERT_NSEQ(n1, n2);
}

TEST(GTestMac, ExpectNSNE) {
  base::mac::ScopedNSAutoreleasePool pool;

  EXPECT_NSNE([NSNumber numberWithInt:2], [NSNumber numberWithInt:42]);
}

TEST(GTestMac, AssertNSNE) {
  base::mac::ScopedNSAutoreleasePool pool;

  ASSERT_NSNE(@"a", @"b");
}

TEST(GTestMac, ExpectNSNil) {
  base::mac::ScopedNSAutoreleasePool pool;

  EXPECT_NSEQ(nil, nil);
  EXPECT_NSNE(nil, @"a");
  EXPECT_NSNE(@"a", nil);

  // TODO(shess): Test that EXPECT_NSNE(nil, nil) fails.
}
<commit_msg>mac: Fix a -Wobjc-redundant-literal-use warning<commit_after>// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Note that while this file is in testing/ and tests GTest macros, it is built
// as part of Chromium's unit_tests target because the project does not build
// or run GTest's internal test suite.

#import "testing/gtest_mac.h"

#import <Foundation/Foundation.h>

#include "base/mac/scoped_nsautorelease_pool.h"
#include "testing/gtest/include/gtest/internal/gtest-port.h"
#include "testing/gtest/include/gtest/gtest.h"

TEST(GTestMac, ExpectNSEQ) {
  base::mac::ScopedNSAutoreleasePool pool;

  EXPECT_NSEQ(@"a", @"a");

  NSString* s1 = [NSString stringWithUTF8String:"a"];
  NSString* s2 = @"a";
  EXPECT_NE(s1, s2);
  EXPECT_NSEQ(s1, s2);
}

TEST(GTestMac, AssertNSEQ) {
  base::mac::ScopedNSAutoreleasePool pool;

  NSNumber* n1 = [NSNumber numberWithInt:42];
  NSNumber* n2 = [NSNumber numberWithInt:42];
  EXPECT_NE(n1, n2);
  ASSERT_NSEQ(n1, n2);
}

TEST(GTestMac, ExpectNSNE) {
  base::mac::ScopedNSAutoreleasePool pool;

  EXPECT_NSNE([NSNumber numberWithInt:2], [NSNumber numberWithInt:42]);
}

TEST(GTestMac, AssertNSNE) {
  base::mac::ScopedNSAutoreleasePool pool;

  ASSERT_NSNE(@"a", @"b");
}

TEST(GTestMac, ExpectNSNil) {
  base::mac::ScopedNSAutoreleasePool pool;

  EXPECT_NSEQ(nil, nil);
  EXPECT_NSNE(nil, @"a");
  EXPECT_NSNE(@"a", nil);

  // TODO(shess): Test that EXPECT_NSNE(nil, nil) fails.
}

{'fraction_non_alphanumeric': 0.1375968992248062, 'fraction_numerical': 0.015503875968992248, 'mean_word_length': 5.048828125, 'pattern_counts': {'":': 0, '<': 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': '4368332', 'n_tokens_mistral': 1198, 'n_tokens_neox': 1151, 'n_words': 275}