Skip to content

Commit a27c779

Browse files
committed
Add contiguous array test
1 parent 759d65e commit a27c779

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SWIFT_SOURCES := main.swift
2+
3+
include Makefile.rules
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""
2+
Test that contiguous array prints correctly
3+
"""
4+
import lldb
5+
from lldbsuite.test.decorators import *
6+
import lldbsuite.test.lldbtest as lldbtest
7+
import lldbsuite.test.lldbutil as lldbutil
8+
import os
9+
import unittest2
10+
11+
12+
class TestContiguousArray(lldbtest.TestBase):
13+
14+
mydir = lldbtest.TestBase.compute_mydir(__file__)
15+
16+
@swiftTest
17+
def test_frame_contiguous_array(self):
18+
"""Test that contiguous array prints correctly"""
19+
self.build()
20+
lldbutil.run_to_source_breakpoint(
21+
self, 'Set breakpoint here', lldb.SBFileSpec('main.swift'))
22+
23+
self.expect("frame variable --dynamic-type run-target",
24+
startstr="""(ContiguousArray<a.Class>) array = {
25+
_buffer = {
26+
_storage = 1 value {
27+
[0] = 0x""")
28+
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Class {}
2+
3+
func use<T>(_ t: T) {}
4+
5+
func main() {
6+
let array = ContiguousArray<Class>([Class()])
7+
use(array)// Set breakpoint here
8+
}
9+
10+
main()
11+

0 commit comments

Comments
 (0)