Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix printOn: message. #50

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions P3-Tests/P3FormattedStatementTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,24 @@ P3FormattedStatementTest >> testNull [
client execute: 'DROP TABLE table1'
]

{ #category : #tests }
P3FormattedStatementTest >> testPrintOn [
"client format: returns a P3FormattedStatement. Use result to test printOn:"

| sql p3fs result|

sql := 'INSERT INTO table1 (id, name) VALUES ($1, $2)'.

p3fs := client format: sql.

result := String streamContents: [ :stream | p3fs printOn: stream ].

self assert: result contents equals: ('a P3FormattedStatement({1})' format: { sql })



]

{ #category : #tests }
P3FormattedStatementTest >> testSimple [
| statement result |
Expand Down
2 changes: 1 addition & 1 deletion P3/P3FormattedStatement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ P3FormattedStatement >> printObject: object on: stream [
{ #category : #printing }
P3FormattedStatement >> printOn: stream [
super printOn: stream.
stream nextPut: $(; << sql; nextPut: $)
stream nextPut: $(; << source; nextPut: $)
]
{ #category : #'printing-dispatched' }
Expand Down
Loading