This repository was archived by the owner on Jul 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
tensor2tensor/data_generators Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 13
13
# See the License for the specific language governing permissions and
14
14
# limitations under the License.
15
15
16
- """Tests for google3.third_party.py.tensor2tensor.data_generators. desc2code."""
16
+ """Tests for desc2code."""
17
17
18
18
from __future__ import absolute_import
19
19
from __future__ import division
20
20
from __future__ import print_function
21
21
22
22
# Dependency imports
23
23
from tensor2tensor .data_generators import desc2code
24
- from google3 .testing .pybase import googletest
25
24
25
+ import tensorflow as tf
26
26
27
27
CODE_CPP_IN = """
28
28
#include <iostream>
39
39
40
40
"""
41
41
42
- CODE_CPP_OUT = "#include <iostream> void main() { /* Not this one */ int a = 3; }" # pylint: disable=line-too-loong
42
+ CODE_CPP_OUT = ("#include <iostream> void main() { /* Not this one */ int a = "
43
+ "3; }" )
43
44
44
45
45
- class Desc2codeTest (googletest .TestCase ):
46
+ class Desc2codeTest (tf . test .TestCase ):
46
47
47
48
def testCppPreprocess (self ):
48
49
"""Check that the file correctly preprocess the code source."""
49
50
cpp_pb = desc2code .Desc2CodeCppProblem ()
50
51
51
52
self .assertEqual ( # Add space beween two lines
52
53
cpp_pb .preprocess_target ("firstline//comm1\n secondline//comm2\n " ),
53
- "firstline secondline"
54
- )
54
+ "firstline secondline" )
55
55
# Checking for boths comments and spaces
56
56
self .assertEqual (cpp_pb .preprocess_target (CODE_CPP_IN ), CODE_CPP_OUT )
57
57
self .assertEqual (
58
58
cpp_pb .preprocess_target (" not removed //abcd " ),
59
- "not removed //abcd"
60
- )
59
+ "not removed //abcd" )
61
60
62
61
63
62
if __name__ == "__main__" :
64
- googletest .main ()
63
+ tf . test .main ()
You can’t perform that action at this time.
0 commit comments