コード例 #1
0
ファイル: source_view_test.py プロジェクト: rm-hull/yalix
    def test_find_outer_form_bounds__parens_and_dblquote_in_string(self):
        src = """
; Some comment
(define x "Something\\\" here :-)")

"""
        prim = TestPrimitive(src, 27)
        self.assertEqual(src, source(prim))
        self.assertEqual('(define x "Something\\\" here :-)")', source_view(prim))
コード例 #2
0
ファイル: source_view_test.py プロジェクト: rm-hull/yalix
    def test_find_outer_form_bounds__no_location(self):
        src = """
; Some comment
(define x "Something\\\" here :-)")

"""
        prim = TestPrimitive(src, None)
        self.assertEqual(src, source(prim))
        self.assertEqual(src, source_view(prim))
コード例 #3
0
ファイル: source_view_test.py プロジェクト: rm-hull/yalix
    def test_find_outer_form_bounds__simple(self):
        src = """
; Some comment
(define x (+ 3 2))

(define (make-counter n)
  (λ ()
    (set! n (+ n 1))))
"""
        prim = TestPrimitive(src, 27)
        self.assertEqual(src, source(prim))
        self.assertEqual('(define x (+ 3 2))', source_view(prim))