summaryrefslogtreecommitdiff
path: root/tools/setup_test.py
diff options
context:
space:
mode:
authorRy Dahl <ry@tinyclouds.org>2020-01-05 09:19:29 -0500
committerGitHub <noreply@github.com>2020-01-05 09:19:29 -0500
commit5f1df038fb1462607af3555fa7431c05ca484dce (patch)
tree0e819c1e1ec422b9573abc379c79fcbcc1cbd88c /tools/setup_test.py
parentc41280a057c9ca300afe43f2cb4f576e050f8cde (diff)
Replace libdeno with rusty_v8 (#3556)
Diffstat (limited to 'tools/setup_test.py')
-rw-r--r--tools/setup_test.py64
1 files changed, 0 insertions, 64 deletions
diff --git a/tools/setup_test.py b/tools/setup_test.py
deleted file mode 100644
index 1d8b1c51a..000000000
--- a/tools/setup_test.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
-import os
-import sys
-from shutil import rmtree
-from tempfile import mktemp
-from setup import gn_string, read_gn_args, write_gn_args
-from test_util import DenoTestCase, run_tests
-
-
-class TestSetup(DenoTestCase):
- def test_gn_string(self):
- assert gn_string('abc') == '"abc"'
- assert gn_string('foo$bar"baz') == '"foo\\$bar\\"baz"'
- assert gn_string('do\\not\\escape') == '"do\\not\\escape"'
- assert gn_string('so\\\\very\\"fun\\') == '"so\\\\\\very\\\\\\"fun\\"'
-
- def test_read_gn_args(self):
- # Args file doesn't exist.
- (args,
- hand_edited) = read_gn_args("/baddir/hopefully/nonexistent/args.gn")
- assert args is None
- assert not hand_edited
-
- # Handwritten empty args file.
- filename = mktemp()
- with open(filename, "w"):
- pass
- (args, hand_edited) = read_gn_args(filename)
- os.remove(filename)
- assert args == []
- assert hand_edited
-
- # Handwritten non-empty args file.
- expect_args = ['some_number=2', 'another_string="ran/dom#yes"']
- filename = mktemp()
- with open(filename, "w") as f:
- f.write("\n".join(expect_args + ["", "# A comment to be ignored"]))
- (args, hand_edited) = read_gn_args(filename)
- os.remove(filename)
- assert args == expect_args
- assert hand_edited
-
- def test_write_gn_args(self):
- # Build a nonexistent path; write_gn_args() should call mkdir as needed.
- d = mktemp()
- filename = os.path.join(d, "args.gn")
- assert not os.path.exists(d)
- assert not os.path.exists(filename)
- # Write some args.
- args = ['lalala=42', 'foo_bar_baz="lorem ipsum dolor#amet"']
- write_gn_args(filename, args)
- # Directory and args file should now be created.
- assert os.path.isdir(d)
- assert os.path.isfile(filename)
- # Validate that the right contents were written.
- (check_args, hand_edited) = read_gn_args(filename)
- assert check_args == args
- assert not hand_edited
- # Clean up.
- rmtree(d)
-
-
-if __name__ == '__main__':
- run_tests()