blob: b613a812c85a49e0617c71a5826cea0e344cb0ac [file] [log] [blame]
Adrià Vilanova Martínezf19ea432024-01-23 20:20:52 +01001# Copyright 2018 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
Copybara854996b2021-09-07 19:36:02 +00004
5"""Unit test for generate_features."""
6from __future__ import print_function
7from __future__ import division
8from __future__ import absolute_import
9
10import unittest
11
12from features import generate_dataset
13
14
15class GenerateFeaturesTest(unittest.TestCase):
16
17 def testCleanText(self):
18 sampleText = """Here's some sample text...$*IT should l00k much\n\n\t,
19 _much_MUCH better \"cleaned\"!"""
20 self.assertEqual(generate_dataset.CleanText(sampleText),
21 ("heres some sample text it should l00k much much much "
22 "better cleaned"))
23 emptyText = ""
24 self.assertEqual(generate_dataset.CleanText(emptyText), "")