整个课程和数据UI重新设计版本
This commit is contained in:
@@ -105,6 +105,32 @@ void main() {
|
||||
expect(jsonDecode(messages![1]['content'] as String), {
|
||||
'reply': "Hi! What's your name?",
|
||||
});
|
||||
expect(messages![2], {'role': 'user', 'content': 'My name is Alex.'});
|
||||
expect(messages![2]['role'], 'user');
|
||||
final last = messages![2]['content'] as String;
|
||||
expect(last, startsWith('My name is Alex.'));
|
||||
expect(
|
||||
last,
|
||||
endsWith('After your line the learner has to: say where they are from.'),
|
||||
);
|
||||
expect(messages![0]['content'], isNot(contains('Ask where the learner')));
|
||||
});
|
||||
|
||||
test('dialogue system prompt stays identical across turns', () {
|
||||
final words = ['Excuse me.', 'Can you help me?'];
|
||||
final a = AiService.dialogueSystemPrompt(
|
||||
level: 'A1',
|
||||
allowedLanguage: words,
|
||||
);
|
||||
final b = AiService.dialogueSystemPrompt(
|
||||
level: 'A1',
|
||||
allowedLanguage: words,
|
||||
);
|
||||
expect(a, b);
|
||||
expect(a, contains('CEFR A1'));
|
||||
expect(a, endsWith('Taught language: Excuse me.; Can you help me?'));
|
||||
expect(
|
||||
AiService.dialogueSystemPrompt(level: 'A0', allowedLanguage: const []),
|
||||
contains('A0 English conversation partner'),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user