<commit_before>Class {
	#name : #T2TraitTest,
	#superclass : #T2AbstractTest,
	#category : #'TraitsV2-Tests'
}

{ #category : #tests }
T2TraitTest >> createT1 [
	| t1 |
	t1 := self newTrait: #T1 with: 'a b c' asSlotCollection.
	t1
		compile:
			'setValues
		a := 1.
		b := 2.
		c := 3.
	'.
	t1
		compile:
			'getValues
		^ a + b + c
	'.
	^ t1
]

{ #category : #tests }
T2TraitTest >> createT2 [
	| t2 |
	t2 := self newTrait: #T2 with: 'd e f' asSlotCollection.
	t2
		compile:
			'setValues2
		d := 1.
		e := 2.
		f := 3.
	'.
	t2
		compile:
			'getValues2
		^ d + e + f + self getValues
	'.
	^ t2
]

{ #category : #tests }
T2TraitTest >> testIndirectSequence [
	| t1 t2 t3 c1 obj |
	
	t1 := self createT1.
	t2 := self createT2.
	t3 := self newTrait: #T3 with: #() uses: t1 + t2.
		
	c1 := self newClass: #C1 with: 'g h' asSlotCollection uses: t3.

	obj := c1 new.
	obj setValues.
	obj setValues2.
	
	self assert: (TraitedClass traitUsers includesAll:  { t1 class. t2 class. t3 class. c1 class}).
	
	self assert: obj getValues equals: 6.
	self assert: obj getValues2 equals: 12
]

{ #category : #tests }
T2TraitTest >> testSequence [
	| t1 t2 c1 obj |
	
	t1 := self createT1.
	t2 := self createT2.
	c1 := self newClass: #C1 with: 'g h' asSlotCollection uses: t1 + t2.

	obj := c1 new.
	obj setValues.
	obj setValues2.
	
	
	self assert: (TraitedClass traitUsers includesAll:  { t1 class. t2 class. c1 class}).
	
	self assert: obj getValues equals: 6.
	self assert: obj getValues2 equals: 12
]<commit_msg>Fixing some tests after changing how TraitedClass knows its users<commit_after>Class {
	#name : #T2TraitTest,
	#superclass : #T2AbstractTest,
	#category : #'TraitsV2-Tests'
}

{ #category : #tests }
T2TraitTest >> createT1 [
	| t1 |
	t1 := self newTrait: #T1 with: 'a b c' asSlotCollection.
	t1
		compile:
			'setValues
		a := 1.
		b := 2.
		c := 3.
	'.
	t1
		compile:
			'getValues
		^ a + b + c
	'.
	^ t1
]

{ #category : #tests }
T2TraitTest >> createT2 [
	| t2 |
	t2 := self newTrait: #T2 with: 'd e f' asSlotCollection.
	t2
		compile:
			'setValues2
		d := 1.
		e := 2.
		f := 3.
	'.
	t2
		compile:
			'getValues2
		^ d + e + f + self getValues
	'.
	^ t2
]

{ #category : #tests }
T2TraitTest >> testIndirectSequence [
	| t1 t2 t3 c1 obj |
	
	t1 := self createT1.
	t2 := self createT2.
	t3 := self newTrait: #T3 with: #() uses: t1 + t2.
		
	c1 := self newClass: #C1 with: 'g h' asSlotCollection uses: t3.

	obj := c1 new.
	obj setValues.
	obj setValues2.
	
	self assert: (TraitedClass basicUsers includesAll:  { t1 class. t2 class. t3 class. c1 class}).
	
	self assert: obj getValues equals: 6.
	self assert: obj getValues2 equals: 12
]

{ #category : #tests }
T2TraitTest >> testSequence [
	| t1 t2 c1 obj |
	
	t1 := self createT1.
	t2 := self createT2.
	c1 := self newClass: #C1 with: 'g h' asSlotCollection uses: t1 + t2.

	obj := c1 new.
	obj setValues.
	obj setValues2.
	
	
	self assert: (TraitedClass basicUsers includesAll:  { t1 class. t2 class. c1 class}).
	
	self assert: obj getValues equals: 6.
	self assert: obj getValues2 equals: 12
]
{'fraction_non_alphanumeric': 0.13294040602488538, 'fraction_numerical': 0.04846103470857891, 'mean_word_length': 2.8283208020050123, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6705808', 'n_tokens_mistral': 1362, 'n_tokens_neox': 1263, 'n_words': 387}