Material class use general question

In my JS I set a material variable:

var someMaterial: Material;

and later I want to test if the object that collides with the object that has this JS attached on it has "someMaterial" and do something:

if (col.gameObject.renderer.material == someMaterial){

...do something...
}

This doesn't work, to be frank I haven't seen gameObject.renderer.material being used anywhere.

eg testing what color the collider has, using gameObject.renderer.material.color works. I want to use materials though.

How would I make this test?

http://unity3d.com/support/documentation/ScriptReference/Renderer-sharedMaterial.html

Renderer.material is an instance, not a reference to the original.

if (col.gameObject.renderer.sharedMaterial == someMaterial)