You can test the code by adding it to your website and then checking if the price is updating dynamically when you change the quantity on the Single Product Page.