X Tutup
Skip to content

Commit b3bd124

Browse files
committed
Copy and adapt Squeak5 to Squeak6
1 parent 0769c67 commit b3bd124

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+369
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"noMethodMetaData" : true,
3+
"separateMethodMetaAndSource" : false,
4+
"useCypressPropertiesFile" : true }
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*grease-tests-squeak6-core
2+
greaseTestsSqueak6Core
3+
^ self new
4+
name: 'Grease-Tests-Squeak6-Core';
5+
description: 'Unit tests for the package Grease-Squeak6-Core.';
6+
addDependency: 'Grease-Squeak6-Core';
7+
addDependency: 'Grease-Tests-Core';
8+
url: #seasideUrl;
9+
yourself
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"class" : {
3+
"greaseTestsSqueak6Core" : "topa 11/15/2017 17:19" },
4+
"instance" : {
5+
} }
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{
2+
"name" : "GRPackage" }

repository/Grease-Tests-Squeak6-Core.package/GRPharoCodecTest.class/README.md

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
private
2+
assert: aString next: anInteger startingAt: startIndex gives: anEncodedString
3+
| actual |
4+
actual := String streamContents: [ :stream |
5+
((GRCodec forEncoding: 'utf-8') encoderFor: stream)
6+
greaseNext: anInteger putAll: aString startingAt: startIndex ].
7+
self assert: actual = anEncodedString
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
private
2+
assertEncodingIgnoresLanguageTat: aStringWithLanguageTag
3+
| codec withLanguageTag withoutLanguageTag |
4+
codec := GRCodec forEncoding: 'utf-8'.
5+
withLanguageTag := codec encode: aStringWithLanguageTag.
6+
withoutLanguageTag := codec encode: (self stripLeadingCharFrom: aStringWithLanguageTag).
7+
self assert: withLanguageTag = withoutLanguageTag
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
private
2+
stripLeadingCharFrom: aString
3+
"strips the leadingChar from every character in the given string"
4+
^ String streamContents: [ :stream |
5+
aString do: [ :each |
6+
stream nextPut: (Character
7+
leadingChar: 0
8+
code: each greaseInteger) ] ]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
tests
2+
testAllCodesIncludesIso88591
3+
self assert: (GRCodec allCodecs anySatisfy: [ :each |
4+
each name = 'iso-8859-1' ])
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
tests
2+
testGreaseNextPutAllStartingAt
3+
| umlaut encodedUmlaut |
4+
umlaut := String with: (Character codePoint: 228).
5+
encodedUmlaut := String with: (Character codePoint: 195) with: (Character codePoint: 164).
6+
self assert: 'ab' next: 1 startingAt: 1 gives: 'a'.
7+
self assert: 'a', umlaut, 'b' next: 1 startingAt: 1 gives: 'a'.
8+
self assert: 'ab', umlaut next: 1 startingAt: 1 gives: 'a'.
9+
self assert: 'a', umlaut, 'b' next: 2 startingAt: 1gives: 'a', encodedUmlaut.
10+
self assert: 'a', umlaut, 'b' next: 1 startingAt: 2 gives: encodedUmlaut.
11+
self assert: 'a', umlaut, 'b' next: 2 startingAt: 2 gives: encodedUmlaut, 'b'.
12+
self assert: 'a', umlaut, umlaut next: 2 startingAt: 2 gives: encodedUmlaut, encodedUmlaut.
13+
self assert: 'ab', umlaut, 'b', umlaut next: 3 startingAt: 2 gives: 'b', encodedUmlaut, 'b'

0 commit comments

Comments
 (0)
X Tutup