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 1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515
16- """Tests for google3.third_party.py.tensor2tensor.data_generators. desc2code."""
16+ """Tests for desc2code."""
1717
1818from __future__ import absolute_import
1919from __future__ import division
2020from __future__ import print_function
2121
2222# Dependency imports
2323from tensor2tensor .data_generators import desc2code
24- from google3 .testing .pybase import googletest
2524
25+ import tensorflow as tf
2626
2727CODE_CPP_IN = """
2828 #include <iostream>
3939
4040"""
4141
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; }" )
4344
4445
45- class Desc2codeTest (googletest .TestCase ):
46+ class Desc2codeTest (tf . test .TestCase ):
4647
4748 def testCppPreprocess (self ):
4849 """Check that the file correctly preprocess the code source."""
4950 cpp_pb = desc2code .Desc2CodeCppProblem ()
5051
5152 self .assertEqual ( # Add space beween two lines
5253 cpp_pb .preprocess_target ("firstline//comm1\n secondline//comm2\n " ),
53- "firstline secondline"
54- )
54+ "firstline secondline" )
5555 # Checking for boths comments and spaces
5656 self .assertEqual (cpp_pb .preprocess_target (CODE_CPP_IN ), CODE_CPP_OUT )
5757 self .assertEqual (
5858 cpp_pb .preprocess_target (" not removed //abcd " ),
59- "not removed //abcd"
60- )
59+ "not removed //abcd" )
6160
6261
6362if __name__ == "__main__" :
64- googletest .main ()
63+ tf . test .main ()
You can’t perform that action at this time.
0 commit comments