File tree Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Expand file tree Collapse file tree 3 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,13 @@ - (void)setCursorLine:(int)line column:(int)column {
83
83
}
84
84
85
85
- (void )print : (NSString *)text {
86
+
87
+ // If a standalone space, convert it to a non-breaking space so
88
+ // that the text system doesn't get any ideas about collapsing it
89
+ if ([text isEqualToString: @" " ]) {
90
+ const unichar nbsp = 0xa0 ;
91
+ text = [NSString stringWithCharacters:   length: 1 ];
92
+ }
86
93
[self .textStorage beginEditing ];
87
94
88
95
// Break into individual lines
Original file line number Diff line number Diff line change @@ -63,10 +63,6 @@ - (instancetype)initWithStory:(Story *)aStory {
63
63
if (0 < len && len <= kMaxStorySize ) {
64
64
parts->_memory =
65
65
new ZMMemory ((const uint8_t *)data.bytes , len, *parts->_io );
66
-
67
- // parts->_memory->getDictionary().dump();
68
- // parts->_memory->getHeader().dump();
69
- // parts->_memory->dump();
70
66
}
71
67
72
68
parts->_error = new ZMErrorAdapter (story);
Original file line number Diff line number Diff line change @@ -69,37 +69,38 @@ - (void)tearDown {
69
69
}
70
70
71
71
- (void )testTimeStatus {
72
+ // Note that the following string tests contain non-breaking spaces
72
73
Story *story = [[Story alloc ] init ];
73
74
[story readFromData: data ofType: @" " error: nil ];
74
75
story.facets [1 ].widthInCharacters = 40 ;
75
76
story.facets [1 ].heightInLines = 1 ;
76
77
[story showStatus ];
77
78
XCTAssertEqualObjects (story.facets [1 ].textStorage .string ,
78
- @" foo 2:03 AM " );
79
+ @" foo 2:03 AM " );
79
80
80
81
[story.zMachine setGlobal: 8 atIndex: 1 ];
81
82
[story.zMachine setGlobal: 0 atIndex: 2 ];
82
83
[story showStatus ];
83
84
XCTAssertEqualObjects (story.facets [1 ].textStorage .string ,
84
- @" foo 8:00 AM " );
85
+ @" foo 8:00 AM " );
85
86
86
87
[story.zMachine setGlobal: 0 atIndex: 1 ];
87
88
[story.zMachine setGlobal: 11 atIndex: 2 ];
88
89
[story showStatus ];
89
90
XCTAssertEqualObjects (story.facets [1 ].textStorage .string ,
90
- @" foo 12:11 AM " );
91
+ @" foo 12:11 AM " );
91
92
92
93
[story.zMachine setGlobal: 12 atIndex: 1 ];
93
94
[story.zMachine setGlobal: 11 atIndex: 2 ];
94
95
[story showStatus ];
95
96
XCTAssertEqualObjects (story.facets [1 ].textStorage .string ,
96
- @" foo 12:11 PM " );
97
+ @" foo 12:11 PM " );
97
98
98
99
[story.zMachine setGlobal: 111 atIndex: 1 ];
99
100
[story.zMachine setGlobal: 99 atIndex: 2 ];
100
101
[story showStatus ];
101
102
XCTAssertEqualObjects (story.facets [1 ].textStorage .string ,
102
- @" foo 99:99 PM " );
103
+ @" foo 99:99 PM " );
103
104
104
105
[story close ];
105
106
}
You can’t perform that action at this time.
0 commit comments