blob: 7a677b36a46d21e3fb7e6e21cdd9196d9450ec79 [file] [log] [blame]
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <locale>
// template <class charT> class collate_byname
// long hash(const charT* low, const charT* high) const;
// This test is not portable
#include <locale>
#include <string>
#include <cassert>
int main()
{
std::locale l("en_US");
{
std::string x1("1234");
std::string x2("12345");
const std::collate<char>& f = std::use_facet<std::collate<char> >(l);
assert(f.hash(x1.data(), x1.data() + x1.size())
!= f.hash(x2.data(), x2.data() + x2.size()));
}
{
std::wstring x1(L"1234");
std::wstring x2(L"12345");
const std::collate<wchar_t>& f = std::use_facet<std::collate<wchar_t> >(l);
assert(f.hash(x1.data(), x1.data() + x1.size())
!= f.hash(x2.data(), x2.data() + x2.size()));
}
}