-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
226 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
OrderedDictionary { | ||
'src\/GraalSqueak-Core.package' : #SquotCypressCodeSerializer, | ||
'src\/GraalSqueak-Tools.package' : #SquotCypressCodeSerializer, | ||
'src\/GraalSqueak-Support.package' : #SquotCypressCodeSerializer | ||
'src\/GraalSqueak-Support.package' : #SquotCypressCodeSerializer, | ||
'src\/GraalSqueak-Tests.package' : #SquotCypressCodeSerializer | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"noMethodMetaData" : true, | ||
"separateMethodMetaAndSource" : false, | ||
"useCypressPropertiesFile" : true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
SquotTrackedObjectMetadata { | ||
#objectClassName : #PackageInfo, | ||
#objectsReplacedByNames : true, | ||
#serializer : #SquotCypressCodeSerializer | ||
} |
Empty file.
5 changes: 5 additions & 0 deletions
5
src/GraalSqueak-Tests.package/JavaTest.class/instance/expectedFailures.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
testing | ||
expectedFailures | ||
^ Java primitiveIsHostLookupAllowed | ||
ifTrue: [ #() ] | ||
ifFalse: [ self class allTestSelectors ] |
4 changes: 4 additions & 0 deletions
4
src/GraalSqueak-Tests.package/JavaTest.class/instance/testJavaAddToHostClassPath.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
testing | ||
testJavaAddToHostClassPath | ||
self assert: Java equals: (Java addToClassPath: 'some.jar'). | ||
"No way to check #addToClassPath: succeeded (apart from looking up symbol that lives in some.jar)." |
13 changes: 13 additions & 0 deletions
13
src/GraalSqueak-Tests.package/JavaTest.class/instance/testJavaArray.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
testing | ||
testJavaArray | ||
| ints | | ||
ints := (Java type: 'int[]') new: 2. | ||
self assert: 2 equals: ints size. | ||
|
||
self should: [ ints at: 0 ] raise: Error. | ||
self assert: 0 equals: (ints at: 1). | ||
self assert: 0 equals: (ints at: 2). | ||
self should: [ ints at: 3 ] raise: Error. | ||
|
||
self assert: 32 equals: (ints at: 1 put: 32). | ||
self assert: 32 equals: (ints at: 1). |
13 changes: 13 additions & 0 deletions
13
src/GraalSqueak-Tests.package/JavaTest.class/instance/testJavaBasic.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
testing | ||
testJavaBasic | ||
self assert: Java primitiveIsHostLookupAllowed. | ||
|
||
self assert: (Java type: 'int[]') primitiveIsHostObject. | ||
self assert: (Java type: 'int[]') primitiveIsHostSymbol. | ||
self assert: ((Java type: 'int[]') new: 0) primitiveIsHostObject. | ||
self deny: ((Java type: 'int[]') new: 0) primitiveIsHostSymbol. | ||
|
||
self assert: (Java type: 'int[]') primitiveIdentityHash > 0. | ||
self assert: 'JavaClass[int]' equals: (Java type: 'int') primitiveStringRepresentation. | ||
|
||
self assert: ((Java type: 'java.lang.System') getProperty: 'java.version') notEmpty. |
5 changes: 5 additions & 0 deletions
5
src/GraalSqueak-Tests.package/JavaTest.class/instance/testJavaString.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
testing | ||
testJavaString | ||
{65. "$A" 16r1f43b "Bear Emoji"} do: [ :ea | | ||
self assert: (String with: (Character value: ea)) | ||
equals: ((Java type: 'java.lang.String') new: ((Java type: 'java.lang.Character') toChars: ea)) ] |
9 changes: 9 additions & 0 deletions
9
src/GraalSqueak-Tests.package/JavaTest.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"expectedFailures" : "fn 11/4/2019 00:16", | ||
"testJavaAddToHostClassPath" : "fn 11/6/2019 12:10", | ||
"testJavaArray" : "fn 11/4/2019 00:13", | ||
"testJavaBasic" : "fn 11/6/2019 12:16", | ||
"testJavaString" : "fn 11/4/2019 00:10" } } |
14 changes: 14 additions & 0 deletions
14
src/GraalSqueak-Tests.package/JavaTest.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "GraalSqueak-Tests", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "JavaTest", | ||
"pools" : [ | ||
], | ||
"super" : "TestCase", | ||
"type" : "normal" } |
Empty file.
5 changes: 5 additions & 0 deletions
5
src/GraalSqueak-Tests.package/PolyglotTest.class/instance/expectedFailures.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
testing | ||
expectedFailures | ||
^ Polyglot supportsMultipleLanguages | ||
ifTrue: [ #() ] | ||
ifFalse: [ self class allTestSelectors ] |
6 changes: 6 additions & 0 deletions
6
src/GraalSqueak-Tests.package/PolyglotTest.class/instance/testLanguageInfo.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
testing | ||
testLanguageInfo | ||
self assert: (Polyglot languageDefaultMimeTypeOf: Polyglot languageIdJS) notEmpty. | ||
self assert: (Polyglot languageMimeTypesOf: Polyglot languageIdJS) notEmpty. | ||
self assert: (Polyglot languageNameOf: Polyglot languageIdJS) notEmpty. | ||
self assert: (Polyglot languageVersionOf: Polyglot languageIdJS) notEmpty. |
3 changes: 3 additions & 0 deletions
3
src/GraalSqueak-Tests.package/PolyglotTest.class/instance/testPolyglotAccess.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
testing | ||
testPolyglotAccess | ||
self assert: Polyglot availableLanguages size > 1 |
12 changes: 12 additions & 0 deletions
12
src/GraalSqueak-Tests.package/PolyglotTest.class/instance/testPolyglotBindings.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
testing | ||
testPolyglotBindings | ||
self shouldnt: [ Polyglot bindings at: 'bindings' ] raise: Error. | ||
self should: [ Polyglot bindings at: 'SmalltalkDict' ] raise: Error. | ||
|
||
self assert: nil equals: (Polyglot import: 'SmalltalkDict'). | ||
self assert: Smalltalk equals: (Polyglot export: 'SmalltalkDict' value: Smalltalk). | ||
self assert: Smalltalk equals: (Polyglot import: 'SmalltalkDict'). | ||
self assert: Smalltalk equals: (Polyglot bindings at: 'SmalltalkDict'). | ||
|
||
Polyglot bindings primitiveRemoveMember: 'SmalltalkDict'. | ||
self should: [ Polyglot bindings at: 'SmalltalkDict' ] raise: Error. |
19 changes: 19 additions & 0 deletions
19
src/GraalSqueak-Tests.package/PolyglotTest.class/instance/testPolyglotEval.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
testing | ||
testPolyglotEval | ||
self assert: Polyglot primitiveIsPolyglotEvalAllowed. | ||
self assert: 7 equals: (Polyglot eval: Polyglot languageIdJS string: '1 + 2 * 3'). | ||
self assert: (42 min: 21) equals: (Polyglot eval: Polyglot languageIdJS string: 'Math.min(42, 21)'). | ||
|
||
self should: [ Polyglot eval: Polyglot languageIdJS string: 'Polyglot eval: "js" string: "1 + 2"' ] raise: Error. | ||
self should: [ Polyglot eval: Polyglot languageIdJS string: 'const _testPolyglotEval = 42; const _testPolyglotEval = 42; _testPolyglotEval' ] raise: Error. | ||
|
||
self assert: 42 equals: (Polyglot eval: Polyglot languageIdJS string: 'global._testPolyglotEval = 42'). | ||
self assert: (Polyglot eval: Polyglot languageIdJS string: 'global._testPolyglotEval' inInnerContext: true) isNil. | ||
self assert: 21 equals: (Polyglot eval: Polyglot languageIdJS string: 'global._testPolyglotEval = 21' inInnerContext: true). | ||
self assert: 42 equals: (Polyglot eval: Polyglot languageIdJS string: 'global._testPolyglotEval'). | ||
self assert: true equals: (Polyglot eval: Polyglot languageIdJS string: 'delete global._testPolyglotEval'). | ||
self assert: (Polyglot eval: Polyglot languageIdJS string: 'global._testPolyglotEval') isNil. | ||
|
||
self assert: 21 equals: (Polyglot eval: Polyglot languageIdJS string: 'const _testPolyglotEvalOther = 21; _testPolyglotEvalOther' inInnerContext: true). | ||
self should: [ Polyglot eval: Polyglot languageIdJS string: '_testPolyglotEvalOther' ] raise: Error. | ||
self assert: 21 equals: (Polyglot eval: Polyglot languageIdJS string: 'let _testPolyglotEvalOther = 21; _testPolyglotEvalOther' inInnerContext: true). |
25 changes: 25 additions & 0 deletions
25
src/GraalSqueak-Tests.package/PolyglotTest.class/instance/testTruffleObjectArray.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
testing | ||
testTruffleObjectArray | ||
| jsArray | | ||
jsArray := (Polyglot eval: 'js' string: '[1, 3, 4]'). | ||
|
||
self assert: jsArray primitiveHasArrayElements. | ||
self assert: 3 equals: jsArray primitiveGetArraySize. | ||
self assert: (jsArray primitiveIsArrayElementExisting: 2). | ||
self deny: (jsArray primitiveIsArrayElementExisting: 5). | ||
self deny: (jsArray primitiveIsArrayElementInsertable: 2). | ||
self assert: (jsArray primitiveIsArrayElementInsertable: 5). | ||
self assert: (jsArray primitiveIsArrayElementModifiable: 2). | ||
self deny: (jsArray primitiveIsArrayElementModifiable: 5). | ||
self assert: (jsArray primitiveIsArrayElementReadable: 2). | ||
self deny: (jsArray primitiveIsArrayElementReadable: 5). | ||
self assert: (jsArray primitiveIsArrayElementRemovable: 2). | ||
self deny: (jsArray primitiveIsArrayElementRemovable: 5). | ||
self assert: (jsArray primitiveIsArrayElementWritable: 2). | ||
self assert: (jsArray primitiveIsArrayElementWritable: 5). | ||
|
||
self assert: 3 equals: (jsArray primitiveReadArrayElement: 2). | ||
self assert: 5 equals: (jsArray primitiveWriteArrayElement: 2 value: 5). | ||
self assert: 5 equals: (jsArray primitiveReadArrayElement: 2). | ||
"TODO: #primitiveRemoveArrayElement: not working correctly in Graal.js (s)ee https://github.com/graalvm/graaljs/issues/218)." | ||
"self assert: jsArray equals: (jsArray primitiveRemoveArrayElement: 2)." |
6 changes: 6 additions & 0 deletions
6
src/GraalSqueak-Tests.package/PolyglotTest.class/instance/testTruffleObjectBasic.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
testing | ||
testTruffleObjectBasic | ||
self assert: (Polyglot eval: Polyglot languageIdJS string: 'null') primitiveIsNull. | ||
|
||
self assert: (Polyglot eval: 'js' string: 'Object') primitiveIsInstantiable. | ||
self assert: 0 equals: ((Polyglot eval: 'js' string: 'Object') primitiveInstantiate: #()) primitiveGetMemberSize |
6 changes: 6 additions & 0 deletions
6
src/GraalSqueak-Tests.package/PolyglotTest.class/instance/testTruffleObjectExecutable.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
testing | ||
testTruffleObjectExecutable | ||
| jsLambda | | ||
jsLambda := (Polyglot eval: Polyglot languageIdJS string: 'x => x'). | ||
self assert: jsLambda primitiveIsExecutable. | ||
self assert: Smalltalk equals: (jsLambda primitiveExecuteWithArguments: {Smalltalk}). |
40 changes: 40 additions & 0 deletions
40
src/GraalSqueak-Tests.package/PolyglotTest.class/instance/testTruffleObjectJSObject.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
testing | ||
testTruffleObjectJSObject | ||
| jsObject | | ||
jsObject := (Polyglot eval: Polyglot languageIdJS string: 'new Object({a: "Foo"})'). | ||
|
||
self deny: jsObject primitiveIsBoolean. | ||
self should: [ jsObject primitiveAsBoolean ] raise: Error. | ||
self deny: jsObject primitiveIsNull. | ||
self deny: jsObject primitiveIsString. | ||
self should: [ jsObject primitiveAsString ] raise: Error. | ||
self deny: jsObject primitiveIsPointer. | ||
self should: [ jsObject primitiveAsPointer ] raise: Error. | ||
self deny: jsObject primitiveFitsInLong. | ||
self should: [ jsObject primitiveAsLong ] raise: Error. | ||
self deny: jsObject primitiveFitsInDouble. | ||
self should: [ jsObject primitiveAsDouble ] raise: Error. | ||
self deny: jsObject primitiveHasArrayElements. | ||
|
||
self assert: 1 equals: jsObject primitiveGetMemberSize. | ||
self assert: jsObject primitiveGetMemberSize equals: jsObject primitiveGetMembers size. | ||
self assert: (jsObject primitiveGetMembers includes: 'a'). | ||
|
||
self assert: jsObject primitiveHasMembers. | ||
self assert: (jsObject primitiveIsMemberExisting: 'a'). | ||
self deny: (jsObject primitiveIsMemberInsertable: 'a'). | ||
self deny: (jsObject primitiveIsMemberInternal: 'a'). | ||
self deny: (jsObject primitiveIsMemberInvocable: 'a'). | ||
self assert: (jsObject primitiveIsMemberModifiable: 'a'). | ||
self assert: (jsObject primitiveIsMemberReadable: 'a'). | ||
self assert: (jsObject primitiveIsMemberRemovable: 'a'). | ||
self assert: (jsObject primitiveIsMemberWritable: 'a'). | ||
self assert: 'Foo' equals: (jsObject primitiveReadMember: 'a'). | ||
|
||
self deny: (jsObject primitiveIsMemberExisting: 'b'). | ||
self assert: (jsObject primitiveIsMemberInsertable: 'b'). | ||
self assert: Smalltalk equals: (jsObject primitiveWriteMember: 'b' value: Smalltalk). | ||
self assert: (jsObject primitiveGetMembers includes: 'b'). | ||
self assert: Smalltalk equals: (jsObject primitiveReadMember: 'b'). | ||
self assert: jsObject equals: (jsObject primitiveRemoveMember: 'b'). | ||
self deny: (jsObject primitiveIsMemberExisting: 'b') |
13 changes: 13 additions & 0 deletions
13
src/GraalSqueak-Tests.package/PolyglotTest.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"expectedFailures" : "fn 10/28/2019 19:13", | ||
"testLanguageInfo" : "fn 10/28/2019 19:14", | ||
"testPolyglotAccess" : "fn 10/28/2019 19:17", | ||
"testPolyglotBindings" : "fn 11/4/2019 01:17", | ||
"testPolyglotEval" : "fn 11/6/2019 11:54", | ||
"testTruffleObjectArray" : "fn 11/6/2019 13:58", | ||
"testTruffleObjectBasic" : "fn 11/6/2019 13:57", | ||
"testTruffleObjectExecutable" : "fn 11/6/2019 13:58", | ||
"testTruffleObjectJSObject" : "fn 11/6/2019 13:58" } } |
14 changes: 14 additions & 0 deletions
14
src/GraalSqueak-Tests.package/PolyglotTest.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "GraalSqueak-Tests", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "PolyglotTest", | ||
"pools" : [ | ||
], | ||
"super" : "TestCase", | ||
"type" : "normal" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SystemOrganization addCategory: #'GraalSqueak-Tests'! |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{ | ||
} |