Question: I was installing shelving in my closets, when drilled a hole into studs, the lights flickered momentarily for 2 seconds. 

I stopped drilling, and everything else seems fine now. The circuit didn't break and the lights are no longer flickering.

There doesn't seem to be any sockets around the switch. 

Should I call an electrician or is there anything I should test?

Answer: 
Since this is closet, there seems to be no real reason not to go ahead and remove the wallboard (or plaster and lath) a few inches to each side of the stud and see if there is a wire there. You should probably get a [non-contact voltage detector](http://www.myhardwaresupply.com/store/p/20448-Voltage-Detector-Non-contact.aspx?feed=Froogle&gclid=CI_IgqDC1c4CFQ02gQodcOQOxw) and check the vicinity of where you are going to cut just in case there is wiring just behind the wall. Nothing particularly special about this model. There are other similar devices from other makers and you can get them at your local big-box store. Note that just if it doesn't detect anything, that doesn't mean you haven't hit a wire. It might just be too far in the wall.

If there is a wire where you drilled, you should assume you've hit it and repair the wiring. If you decide to fix it yourself, make sure match the wire gauges and put any splices in a junction box that is accessible.

Repairing the wall is fairly easy if you don't have to worry about making it look nice and generally that's not a concern inside a closet. Just cut a piece of drywall a little larger than the hole you created, put it over the hole, trace around it and cut the hole to fit the piece, screw the piece to the stud (short screws!) apply a little mesh tape and smooth on some joint compound.
I'm thinking about something else than drilling into a wire.
The power used by your drill could've been high and made the light flicker because it was nearly the maximum this power line could provide.