diff --git a/python/cudf/cudf/tests/test_series.py b/python/cudf/cudf/tests/test_series.py index ca179703864..cd18177fcf0 100644 --- a/python/cudf/cudf/tests/test_series.py +++ b/python/cudf/cudf/tests/test_series.py @@ -1272,3 +1272,47 @@ def test_series_sort_index( assert_eq(ps, gs, check_index_type=True) else: assert_eq(expected, got, check_index_type=True) + + +@pytest.mark.parametrize( + "method,validation_data", + [ + ( + "md5", + [ + "d41d8cd98f00b204e9800998ecf8427e", + "cfcd208495d565ef66e7dff9f98764da", + "3d3aaae21d57b101227f0384f644abe0", + "3e76c7023d771ad1c1520c27ab3d4874", + "f8d805e33ec3ade1a6ea251ac1c118e7", + "c30515f66a5aec7af7666abf33600c92", + "c61a4185135eda043f35e92c3505e180", + "52da74c75cb6575d25be29e66bd0adde", + "5152ac13bdd09110d9ee9c169a3d9237", + "f1d3ff8443297732862df21dc4e57262", + ], + ) + ], +) +def test_series_hash_values(method, validation_data): + inputs = cudf.Series( + [ + "", + "0", + "A 56 character string to test message padding algorithm.", + "A 63 character string to test message padding algorithm, again.", + "A 64 character string to test message padding algorithm, again!!", + ( + "A very long (greater than 128 bytes/char string) to execute " + "a multi hash-step data point in the hash function being " + "tested. This string needed to be longer." + ), + "All work and no play makes Jack a dull boy", + "!\"#$%&'()*+,-./0123456789:;<=>?@[\\]^_`{|}~", + "\x00\x00\x00\x10\x00\x00\x00\x00", + "\x00\x00\x00\x00", + ] + ) + validation_results = cudf.Series(validation_data) + hash_values = inputs.hash_values(method=method) + assert_eq(hash_values, validation_results)