comparison tests/test-highlight.t @ 41732:9d39671adadb

tests: use NO_CHECK_EOF as heredoc limit mark to omit checking code fragments This is a part of preparation to apply checking with check-code.py on code fragments embedded in *.t test scripts. "primes.py" embedded in test-highlight.t causes an error of check-commit.py below: don't use .next(), use next(...) But changing embedded primes.py is painful, because it is committed in test script, and affects hash IDs. On the other hand, primes.py itself is never executed in test script. Therefore, this patch uses NO_CHECK_EOF as heredoc limit mark in order to omit any checking on this code fragments.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Mon, 18 Feb 2019 00:27:25 +0900
parents 3b84ef904aea
children e7eb67eab53f
comparison
equal deleted inserted replaced
41731:92055d539e49 41732:9d39671adadb
17 > -e "s/class=\"\([cs]\)[h12]\"/class=\"\1\"/g" 17 > -e "s/class=\"\([cs]\)[h12]\"/class=\"\1\"/g"
18 > } 18 > }
19 19
20 create random Python file to exercise Pygments 20 create random Python file to exercise Pygments
21 21
22 $ cat <<EOF > primes.py 22 $ cat <<NO_CHECK_EOF > primes.py
23 > """Fun with generators. Corresponding Haskell implementation: 23 > """Fun with generators. Corresponding Haskell implementation:
24 > 24 >
25 > primes = 2 : sieve [3, 5..] 25 > primes = 2 : sieve [3, 5..]
26 > where sieve (p:ns) = p : sieve [n | n <- ns, mod n p /= 0] 26 > where sieve (p:ns) = p : sieve [n | n <- ns, mod n p /= 0]
27 > """ 27 > """
49 > n = int(sys.argv[1]) 49 > n = int(sys.argv[1])
50 > except (ValueError, IndexError): 50 > except (ValueError, IndexError):
51 > n = 10 51 > n = 10
52 > p = primes() 52 > p = primes()
53 > print("The first %d primes: %s" % (n, list(itertools.islice(p, n)))) 53 > print("The first %d primes: %s" % (n, list(itertools.islice(p, n))))
54 > EOF 54 > NO_CHECK_EOF
55 $ echo >> primes.py # to test html markup with an empty line just before EOF 55 $ echo >> primes.py # to test html markup with an empty line just before EOF
56 $ hg ci -Ama 56 $ hg ci -Ama
57 adding primes.py 57 adding primes.py
58 58
59 hg serve 59 hg serve