aboutsummaryrefslogtreecommitdiff
path: root/absl/flags/tests
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2019-03-21 03:12:33 -0700
committerCopybara-Service <copybara-worker@google.com>2019-03-21 03:12:49 -0700
commit9374e0f37095d88490e75364bb8b74b07bebfe47 (patch)
tree964dcacb08bcfce1f1832ea8b8c6bc43a7c7c899 /absl/flags/tests
parent9a5a195ed6409ed9a09b0d29f61d01b6ab90d739 (diff)
downloadabsl-py-9374e0f37095d88490e75364bb8b74b07bebfe47.tar.gz
Add explicit tests for octal flags.
PiperOrigin-RevId: 239564996
Diffstat (limited to 'absl/flags/tests')
-rw-r--r--absl/flags/tests/flags_test.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/absl/flags/tests/flags_test.py b/absl/flags/tests/flags_test.py
index ac77707..0f69294 100644
--- a/absl/flags/tests/flags_test.py
+++ b/absl/flags/tests/flags_test.py
@@ -328,6 +328,11 @@ class FlagsUnitTest(absltest.TestCase):
self.assertEqual(FLAGS.x, 0x1234567890ABCDEF1234567890ABCDEF)
self.assertIsInstance(FLAGS.x, six.integer_types)
+ argv = ('./program', '--x', '0o12345')
+ argv = FLAGS(argv)
+ self.assertEqual(FLAGS.x, 0o12345)
+ self.assertEqual(type(FLAGS.x), int)
+
# Treat 0-prefixed parameters as base-10, not base-8
argv = ('./program', '--x', '012345')
argv = FLAGS(argv)