def test_different_languages(self):
        """Test code format reward with different programming languages."""
        completion = [
            [
                {
                    "content": "<think>\nAnalysis\n</think>\n<answer>\n```javascript\nconsole.log('hello');\n```\n</answer>"
                }
            ]
        ]

        # Test with JavaScript
        js_reward_fn = get_code_format_reward(language="javascript")
        rewards = js_reward_fn(completion)
        self.assertEqual(rewards[0], 1.0)

        # Same completion should fail for Python
        py_reward_fn = get_code_format_reward(language="python")
        rewards = py_reward_fn(completion)
        self.assertEqual(rewards[0], 0.0)
Test code format reward with different programming languages.
tests/test_rewards.py